From 1d2a94f5acfa56336ac74bf68a76c87b10fcb411 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 16 Oct 2026 11:17:10 +0000 Subject: [PATCH] Fold Windows path separators in the golden manifest JSON test The manifest JSON writes a Windows path with escaped backslashes, so the byte-exact golden hashes only held on posix. Fold them to forward slashes before hashing; posix bytes are unchanged. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01N7hYfMaQFqSMBtq9ZWJ3gV --- tests/test_native3d/test_pixel_unchanged.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_native3d/test_pixel_unchanged.py b/tests/test_native3d/test_pixel_unchanged.py index 5a63d63..cabcae7 100644 --- a/tests/test_native3d/test_pixel_unchanged.py +++ b/tests/test_native3d/test_pixel_unchanged.py @@ -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")