From c7f42c10e52ead090f9ca04213476ced38806228 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Tue, 19 May 2026 18:15:59 -0400 Subject: [PATCH] fix(test): verify_integrity sha-mismatch row needs a distinct path (image_record.path is unique) Co-Authored-By: Claude Opus 4.7 (1M context) --- tests/test_verify_integrity.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_verify_integrity.py b/tests/test_verify_integrity.py index ee4593a..cc05e3b 100644 --- a/tests/test_verify_integrity.py +++ b/tests/test_verify_integrity.py @@ -59,6 +59,8 @@ def test_ok_corrupt_failed_paths(db_sync, tmp_path, monkeypatch): good = tmp_path / "good.jpg" _good_jpeg(good) + good2 = tmp_path / "good2.jpg" # distinct path — image_record.path is unique + _good_jpeg(good2) bad = tmp_path / "bad.jpg" bad.write_bytes(b"not a real jpeg") truncated = tmp_path / "trunc.jpg" @@ -66,7 +68,7 @@ def test_ok_corrupt_failed_paths(db_sync, tmp_path, monkeypatch): truncated.write_bytes(truncated.read_bytes()[:30]) # break the bitstream rec_ok = _rec(db_sync, good, sha=_sha_of(good)) - rec_sha_mismatch = _rec(db_sync, good, sha="0" * 64) # bytes intact, sha wrong + rec_sha_mismatch = _rec(db_sync, good2, sha="0" * 64) # bytes intact, sha wrong → corrupt rec_decode_fail = _rec(db_sync, truncated, sha=_sha_of(truncated)) # 'bad' has not-jpeg bytes; sha matches the bad bytes → decode fails rec_bad_decode = _rec(db_sync, bad, sha=_sha_of(bad))