core/structure: add partial matching

This commit is contained in:
Sean Breckenridge 2022-02-09 21:07:59 -08:00
parent 62832a6756
commit b2ffc20b73
2 changed files with 20 additions and 7 deletions

View file

@ -29,6 +29,14 @@ def test_gdpr_unzip() -> None:
assert not extracted.exists()
def test_match_partial() -> None:
# a partial match should match both the 'broken' and 'gdpr_export' directories
with match_structure(
structure_data / "gdpr_subdirs", expected=gdpr_expected, partial=True
) as results:
assert len(results) == 2
def test_not_directory() -> None:
with pytest.raises(NotADirectoryError, match=r"Expected either a zipfile or a directory"):
with match_structure(