core/structure: add partial matching (#212)

* core/structure: add partial matching
This commit is contained in:
seanbreckenridge 2022-02-10 00:49:13 -08:00 committed by GitHub
parent 62832a6756
commit bea2c6a201
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 8 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(