diff --git a/tests/test_gitlinks.py b/tests/test_gitlinks.py index 8e668202..ceb8c1ef 100644 --- a/tests/test_gitlinks.py +++ b/tests/test_gitlinks.py @@ -1348,7 +1348,7 @@ def test_installed_ocr_projected_review_matches_native_manifest( ) -> None: """Opt-in production proof against the official binary and local fake provider.""" - binary, _version = qualified_native_ocr("OCR_GITLINK_QUALIFY_BINARY") + binary, version = qualified_native_ocr("OCR_GITLINK_QUALIFY_BINARY") monkeypatch.syspath_prepend(str(Path(__file__).resolve().parents[1] / "scripts")) from ocr_qualification.peer import _stub_gateway @@ -1397,12 +1397,24 @@ def test_installed_ocr_projected_review_matches_native_manifest( timeout=30, ) assert preview.returncode == 0 and preview.stderr == b"" + if kind == "ordinary" and version == "1.14.5": + # This qualified binary omits tracked gitignored files from preview. + assert {entry.path for entry in projection.ordinary_diff} == {"hidden.py", "selected.py"} + assert [item["path"] for item in json.loads(preview.stdout)["files"]] == ["selected.py"] + with pytest.raises(RepositoryEvidenceError, match="omitted or added diff records"): + qualify_review_preview(projection, preview.stdout) + return selection = qualify_review_preview(projection, preview.stdout) selected = selection.selected assert selected assert all(entry.status != "D" for entry in selected) if kind in {"added", "updated", "deleted"}: assert selected == projection.ordinary_diff + elif kind == "ordinary": + assert [entry.path for entry in selected] == ["selected.py"] + assert [(item.entry.path, item.reason) for item in selection.excluded] == [ + ("hidden.py", "gitignore") + ] elif kind == "ordinary-non-utf8": assert [entry.path for entry in selected] == ["selected.py"] assert [(item.entry.path, item.reason) for item in selection.excluded] == [