test: the empty duplicate report carries suggestion now — assert shape, not the exact dict
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 7s
CI & Build / TypeScript typecheck (push) Successful in 10s
CI & Build / integration (push) Successful in 12s
CI & Build / Python tests (push) Successful in 46s
CI & Build / Build & push image (push) Successful in 35s

The step-5 field addition (d7039dc) broke a test pinning the error-path
return literally. The field is deliberate: a failed scan must match a clean
scan in shape, or every consumer grows a second code path for the degraded
case. Assert the parts instead.

Refs #2547
This commit is contained in:
2026-08-08 18:58:37 -04:00
parent d7039dc17c
commit 52bf40de4f
+6 -1
View File
@@ -96,4 +96,9 @@ async def test_a_failed_scan_returns_an_empty_report_not_an_error():
patch.object(dedup_svc, "async_session", side_effect=RuntimeError("boom")), patch.object(dedup_svc, "async_session", side_effect=RuntimeError("boom")),
): ):
out = await dedup_svc.find_duplicate_snippets(1) out = await dedup_svc.find_duplicate_snippets(1)
assert out == {"groups": [], "pairs": [], "threshold": 0.8} # The empty report still carries its per-kind `suggestion` (#2547) — a
# failed scan must be indistinguishable in SHAPE from a clean one, or every
# consumer needs a second code path for the degraded case.
assert out["groups"] == [] and out["pairs"] == []
assert out["threshold"] == 0.8
assert "merge" in out["suggestion"]