fix: count unique media coverage
This commit is contained in:
@@ -107,5 +107,20 @@ def test_media_coverage_keeps_unknown_tackle_total_honest(tmp_path: Path) -> Non
|
||||
encoding="utf-8",
|
||||
)
|
||||
report = media_coverage(tmp_path)["entities"]
|
||||
assert report["fish"] == {"expected": 2, "candidates": 2, "approved": 1, "candidate_gap": 0, "approved_gap": 1}
|
||||
assert report["fish"] == {
|
||||
"expected": 2, "candidate_assets": 2, "unique_candidates": 0,
|
||||
"unidentified_assets": 2, "approved": 1, "candidate_gap": 2, "approved_gap": 1,
|
||||
}
|
||||
assert report["tackle"]["candidate_gap"] is None
|
||||
|
||||
|
||||
def test_media_coverage_deduplicates_candidate_labels(tmp_path: Path) -> None:
|
||||
(tmp_path / "manifest.json").write_text(
|
||||
'{"assets":[{"entity_type":"fish","status":"queued","label":" Ерш "},'
|
||||
'{"entity_type":"fish","status":"queued","label":"ерш"}]}', encoding="utf-8",
|
||||
)
|
||||
(tmp_path / "catalog-baseline.json").write_text(
|
||||
'{"verified_at":"2026-09-12","entities":{"fish":{"count":2}}}', encoding="utf-8",
|
||||
)
|
||||
fish = media_coverage(tmp_path)["entities"]["fish"]
|
||||
assert (fish["candidate_assets"], fish["unique_candidates"], fish["candidate_gap"]) == (2, 1, 1)
|
||||
|
||||
Reference in New Issue
Block a user