feat(phash): import task maps 'superseded' to complete + re-queues ML/thumbnail
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -136,3 +136,21 @@ def test_threshold_controls_match(importer, import_layout):
|
||||
_write(b, (104, 100, 100), (900, 900)) # tiny tweak
|
||||
r = importer.import_one(b)
|
||||
assert r.status == "imported" # threshold 0 → not treated as near-dup
|
||||
|
||||
|
||||
def test_import_task_maps_superseded_to_complete_and_requeues():
|
||||
from backend.app.services.importer import ImportResult
|
||||
from backend.app.tasks.import_file import _map_result_to_status
|
||||
|
||||
assert _map_result_to_status(
|
||||
ImportResult(status="superseded", image_id=5)
|
||||
) == ("complete", True)
|
||||
assert _map_result_to_status(
|
||||
ImportResult(status="imported", image_id=5)
|
||||
) == ("complete", True)
|
||||
assert _map_result_to_status(
|
||||
ImportResult(status="skipped", skip_reason=SkipReason.duplicate_phash)
|
||||
) == ("skipped", False)
|
||||
assert _map_result_to_status(
|
||||
ImportResult(status="failed", error="boom")
|
||||
) == ("failed", False)
|
||||
|
||||
Reference in New Issue
Block a user