Add fail-closed sample filters to label QA
GeoIntel release gates / Compile, test, contracts and builds (push) Canceled after 0s
GeoIntel release gates / Python and npm vulnerability policy (push) Canceled after 0s
GeoIntel release gates / GIS image, SBOM and container scan (push) Canceled after 0s

This commit is contained in:
Jens
2026-07-30 02:49:57 +02:00
parent 1267beb37b
commit 17984820e1
2 changed files with 46 additions and 1 deletions
@@ -0,0 +1,26 @@
import pytest
from scripts.render_operator_yolo_label_qa_contact_sheets import filter_tiles_by_samples
TILES = [
{"sample_slug": "genk-industry-train"},
{"sample_slug": "lokeren-ribbon-train"},
{"sample_slug": "ostend-coastal-train"},
]
def test_filter_tiles_by_samples_keeps_only_explicit_samples() -> None:
assert filter_tiles_by_samples(TILES, ["genk-industry-train", "ostend-coastal-train"]) == [
TILES[0],
TILES[2],
]
def test_filter_tiles_by_samples_rejects_missing_sample() -> None:
with pytest.raises(ValueError, match="absent from summary"):
filter_tiles_by_samples(TILES, ["missing"])
def test_filter_tiles_by_samples_without_filter_preserves_tiles() -> None:
assert filter_tiles_by_samples(TILES, []) is TILES