File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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" ]
You can’t perform that action at this time.
0 commit comments