Skip to content

Commit

Permalink
Write deterministic test-svg across platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
titusz committed Jul 2, 2024
1 parent 6ee74fa commit edf815f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def svg_file(tmp_path_factory) -> str:
<circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />
</svg>
"""
dst.write_text(svg_content)
dst.write_bytes(svg_content.encode("utf-8"))
return dst.as_posix()


Expand Down
6 changes: 3 additions & 3 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,10 @@ def test_code_iscc_sum_fallback(svg_file):
idk.sdk_opts.fallback = True
result = idk.code_iscc(svg_file)
assert result.dict(exclude={"generator"}) == {
"iscc": "ISCC:KUANKOEXL4BT2TTJ3C2GRRPQNMTRM",
"iscc": "ISCC:KUAHPKDWWUYLTV2LWK6LTRJQP33TO",
"filename": "image.svg",
"filesize": 175,
"filesize": 171,
"mediatype": "image/svg+xml",
"datahash": "1e20d8b468c5f06b2716389976e2e3e7f2cff0a9c39c3b6a771a6a16a3f6edaf67ef",
"datahash": "1e20b2bcb9c5307ef7376aafb8fea6440399d7e6520fe43402e5e5943a51af25a748",
}
idk.sdk_opts.fallback = False

0 comments on commit edf815f

Please sign in to comment.