Skip to content

Commit aa65d02

Browse files
committed
checkpoint: test that the path and examples match
1 parent 99c4951 commit aa65d02

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

tests/test_packsmanager.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,21 @@ def test_available_examples(input, expected, example_cases):
6666
print("actual:")
6767
pprint(actual)
6868
# assert that the keys are the same
69-
assert actual.keys() == expected.keys()
69+
70+
assert (
71+
actual.keys() == expected.keys()
72+
), f"Keys differ: expected {expected.keys()}, got {actual.keys()}"
7073
# if values of excepted are in actual assert true
7174
# assert actual == expected
75+
for expected_pack, expected_tuple in expected.items():
76+
assert expected_pack in actual, f"Missing pack: {expected_pack}"
77+
for expected_name, expected_rel_path in expected_tuple:
78+
matches = [
79+
(name, path)
80+
for name, path in actual[expected_pack]
81+
if name == expected_name and expected_rel_path in str(path)
82+
]
83+
assert matches, (
84+
f"Expected example '{expected_name}' with path containing "
85+
f"'{expected_rel_path}' not found in {actual[expected_pack]}"
86+
)

0 commit comments

Comments
 (0)