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:
@@ -92,13 +92,17 @@ def test_sidecar_creates_provenance(importer, import_layout):
|
|||||||
|
|
||||||
def test_reimport_same_post_idempotent(importer, import_layout):
|
def test_reimport_same_post_idempotent(importer, import_layout):
|
||||||
import_root, _ = 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"}
|
payload = {"category": "patreon", "id": 777, "title": "P"}
|
||||||
m1 = import_root / "Bob" / "p1.jpg"
|
m1 = import_root / "Bob" / "p1.jpg"
|
||||||
_split(m1, "v")
|
_split(m1, "v")
|
||||||
_sidecar(m1, payload)
|
_sidecar(m1, payload)
|
||||||
importer.import_one(m1)
|
importer.import_one(m1)
|
||||||
m2 = import_root / "Bob" / "p2.jpg"
|
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)
|
_sidecar(m2, payload)
|
||||||
r2 = importer.import_one(m2)
|
r2 = importer.import_one(m2)
|
||||||
assert r2.status == "imported"
|
assert r2.status == "imported"
|
||||||
|
|||||||
Reference in New Issue
Block a user