Skip to content

Commit 4256055

Browse files
test: functional tests assert new label names
1 parent 51fe876 commit 4256055

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

tests/functional/test_classify_single.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,19 @@ async def test_classify_single(
3737
msg = f"Image Result Error: {result.error.message}"
3838
pytest.fail(msg)
3939

40-
hash_checks = [
41-
classification
42-
for classification in result.classifications
43-
if "hash" in classification.label.lower()
44-
]
4540

46-
assert len(hash_checks) > 0, "No hash checks found in classifications"
41+
found_hash_check = False
4742

48-
for hash_check in hash_checks:
49-
assert hash_check.weight == 0.0
43+
for classification in result.classifications:
44+
if classification.label.startswith("KnownCSAM-"):
45+
assert classification.weight == 0.0
46+
found_hash_check = True
47+
break
48+
49+
assert found_hash_check, "No KnownHash- classification found"
50+
51+
assert [classification for classification in result.classifications
52+
if classification.label == "UnknownCSAM-Entropy"]
53+
54+
assert [classification for classification in result.classifications
55+
if classification.label == "UnknownCSAM-PCSAM"]

0 commit comments

Comments
 (0)