Skip to content

Commit

Permalink
Debug Windows assertion failure
Browse files Browse the repository at this point in the history
  • Loading branch information
clyde-johnston committed Jun 11, 2023
1 parent c35a5c4 commit 78d2472
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pydsdl/_namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,29 +604,29 @@ def _unittest_common_usage_errors() -> None:

with tempfile.TemporaryDirectory() as directory:
di = Path(directory)
root_ns_dir = di / "foo"
root_ns_dir = di.joinpath("foo")
root_ns_dir.mkdir()

reports = [] # type: List[str]

_ensure_no_common_usage_errors(root_ns_dir, [], reports.append)
assert not reports
_ensure_no_common_usage_errors(root_ns_dir, [di / "baz"], reports.append)
_ensure_no_common_usage_errors(root_ns_dir, [di.joinpath("baz")], reports.append)
assert not reports

dir_dsdl = root_ns_dir / "dsdl"
dir_dsdl = root_ns_dir.joinpath("dsdl")
dir_dsdl.mkdir()
_ensure_no_common_usage_errors(dir_dsdl, [di / "baz"], reports.append)
_ensure_no_common_usage_errors(dir_dsdl, [di.joinpath("baz")], reports.append)
assert not reports # Because empty.

dir_dsdl_vscode = dir_dsdl / ".vscode"
dir_dsdl_vscode = dir_dsdl.joinpath(".vscode")
dir_dsdl_vscode.mkdir()
_ensure_no_common_usage_errors(dir_dsdl, [di / "baz"], reports.append)
_ensure_no_common_usage_errors(dir_dsdl, [di.joinpath("baz")], reports.append)
assert not reports # Because the name is not valid.

dir_dsdl_uavcan = dir_dsdl / "uavcan"
dir_dsdl_uavcan = dir_dsdl.joinpath("uavcan")
dir_dsdl_uavcan.mkdir()
_ensure_no_common_usage_errors(dir_dsdl, [di / "baz"], reports.append)
_ensure_no_common_usage_errors(dir_dsdl, [di.joinpath("baz")], reports.append)
(rep,) = reports
reports.clear()
assert str(dir_dsdl_uavcan).lower() in rep.lower()
Expand Down

0 comments on commit 78d2472

Please sign in to comment.