Add fail-closed sample filters to label QA
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user