Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions tests/test_native3d/test_pixel_unchanged.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,17 @@ def _manifest(water_column: WaterColumn | None = None) -> ProjectManifest:
)


def _posix(text: str) -> bytes:
return text.replace("\\\\", "/").encode()


def test_a_pixel_manifest_hashes_and_serialises_as_before() -> None:
manifest = _manifest()
assert manifest.project_hash() == GOLDEN_HASH
indented = manifest.model_dump_json(indent=2).encode()
# A Windows path is written with escaped backslashes; fold them so the golden bytes hold there
indented = _posix(manifest.model_dump_json(indent=2))
assert hashlib.sha256(indented).hexdigest() == GOLDEN_JSON_INDENT_SHA
assert hashlib.sha256(manifest.model_dump_json().encode()).hexdigest() == GOLDEN_JSON_SHA
assert hashlib.sha256(_posix(manifest.model_dump_json())).hexdigest() == GOLDEN_JSON_SHA
assert "water_column" not in manifest.calibration.model_dump(mode="json")


Expand Down