Skip to content

Commit

Permalink
tests:siegfried - update to handle files with not matches
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoCampinoti94 committed Nov 20, 2023
1 parent 6834102 commit 80cdfaa
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/test_siegfried.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ def test_identify(siegfried: Siegfried, test_files: Path, test_files_data: dict[
assert result.filesize == filedata["filesize"]
assert result.matches
assert result.matches[0].model_dump() == filedata["matches"]
assert result.best_match().model_dump() == filedata["matches"]
assert (
result.best_match() is None and filedata["matches"]["id"] is None
) or result.best_match().model_dump() == filedata["matches"]


def test_identify_many(siegfried: Siegfried, test_files: Path, test_files_data: dict[str, dict]):
Expand All @@ -74,5 +76,6 @@ def test_identify_many(siegfried: Siegfried, test_files: Path, test_files_data:
assert result.filename == str(test_files / filename)
assert result.filesize == filedata["filesize"]
assert result.matches
assert result.matches[0].model_dump() == filedata["matches"]
assert result.best_match().model_dump() == filedata["matches"]
assert (
result.best_match() is None and filedata["matches"]["id"] is None
) or result.best_match().model_dump() == filedata["matches"]

0 comments on commit 80cdfaa

Please sign in to comment.