Files
geointel/backend/tests/test_operator_polygon_label_qa.py
Jens faeb58ef6d
GeoIntel release gates / Compile, test, contracts and builds (push) Successful in 1m49s
GeoIntel release gates / Python and npm vulnerability policy (push) Successful in 21s
GeoIntel release gates / Production AI image, SBOM and container scan (push) Successful in 5m39s
GeoIntel release gates / Deploy exact gated revision to Unraid (push) Failing after 58m43s
Initial public release
2026-08-31 21:56:53 +02:00

23 lines
776 B
Python

from scripts.render_operator_polygon_label_qa import geometry_rings
def test_geometry_rings_yields_polygon_exterior_and_hole() -> None:
exterior = [[0, 0], [1, 0], [1, 1], [0, 0]]
hole = [[0.2, 0.2], [0.4, 0.2], [0.2, 0.2]]
assert list(geometry_rings({"type": "Polygon", "coordinates": [exterior, hole]})) == [
exterior,
hole,
]
def test_geometry_rings_flattens_multipolygon_rings() -> None:
first = [[0, 0], [1, 0], [0, 0]]
second = [[2, 2], [3, 2], [2, 2]]
assert list(
geometry_rings({"type": "MultiPolygon", "coordinates": [[first], [second]]})
) == [first, second]
def test_geometry_rings_ignores_non_polygon_geometry() -> None:
assert list(geometry_rings({"type": "Point", "coordinates": [0, 0]})) == []