fix(test): sidecar idempotency needs phash_threshold=0 (orthogonal splits collapse at default)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-18 15:13:48 -04:00
parent 9b79b66b76
commit 9d433fc1ab
+5 -1
View File
@@ -92,13 +92,17 @@ def test_sidecar_creates_provenance(importer, import_layout):
def test_reimport_same_post_idempotent(importer, import_layout):
import_root, _ = import_layout
# Threshold 0: only an exact phash match collapses. Orthogonal splits
# still sit within the default Hamming-10 at 64-bit, so without this
# the 2nd image would be skipped as a near-dup (phash dedup working).
importer.settings.phash_threshold = 0
payload = {"category": "patreon", "id": 777, "title": "P"}
m1 = import_root / "Bob" / "p1.jpg"
_split(m1, "v")
_sidecar(m1, payload)
importer.import_one(m1)
m2 = import_root / "Bob" / "p2.jpg"
_split(m2, "h") # structurally distinct → not a phash dup
_split(m2, "h") # distinct phash; threshold 0 → both import
_sidecar(m2, payload)
r2 = importer.import_one(m2)
assert r2.status == "imported"