Skip to content

Commit c7decbe

Browse files
committed
fix: benchmark
1 parent dbad283 commit c7decbe

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

tests/benchmark.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import os
1515
import io
16+
import json
1617
import pytest
1718
from c2pa import Reader, Builder, Signer, C2paSigningAlg, C2paSignerInfo
1819

@@ -76,7 +77,13 @@ def test_files_read():
7677
reader = Reader("image/jpeg", f)
7778
result = reader.json()
7879
assert result is not None
79-
return result
80+
# Parse the JSON string into a dictionary
81+
result_dict = json.loads(result)
82+
# Additional assertions to verify the structure of the result
83+
assert "active_manifest" in result_dict
84+
assert "manifests" in result_dict
85+
assert "validation_state" in result_dict
86+
assert result_dict["validation_state"] == "Valid"
8087

8188

8289
def test_streams_read():
@@ -86,7 +93,13 @@ def test_streams_read():
8693
reader = Reader("image/jpeg", io.BytesIO(source))
8794
result = reader.json()
8895
assert result is not None
89-
return result
96+
# Parse the JSON string into a dictionary
97+
result_dict = json.loads(result)
98+
# Additional assertions to verify the structure of the result
99+
assert "active_manifest" in result_dict
100+
assert "manifests" in result_dict
101+
assert "validation_state" in result_dict
102+
assert result_dict["validation_state"] == "Valid"
90103

91104

92105
def test_files_build():

0 commit comments

Comments
 (0)