Skip to content

Commit 77cf317

Browse files
split_area: add unit test for invalid AOI #883
1 parent 5c046f2 commit 77cf317

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

tests/extra/job_management/test_job_splitting.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ def test_constructor_rejects_non_positive_size(self, size):
3434
with pytest.raises(JobSplittingFailure, match="Tile size must be positive"):
3535
_SizeBasedTileGrid(epsg=4326, size=size)
3636
def test_get_tiles_raises_exception(self):
37-
"""test get_tiles when the input geometry is not a dict or shapely.geometry.Polygon"""
37+
"""get_tiles rejects input that is not a dict, Polygon, or MultiPolygon."""
3838
tile_grid = _SizeBasedTileGrid(epsg=4326, size=0.1)
39-
with pytest.raises(JobSplittingFailure):
39+
with pytest.raises(JobSplittingFailure, match="Expected a bounding-box dict"):
4040
tile_grid.get_tiles("invalid_geometry")
4141

4242
def test_get_tiles_returns_geodataframe(self):
@@ -304,3 +304,8 @@ def test_split_area_3857(self):
304304
assert len(result) == 1
305305
assert result.geometry[0].equals(shapely.geometry.box(0.0, 0.0, 20_000.0, 20_000.0))
306306
assert result.crs.to_epsg() == 3857
307+
308+
def test_invalid_aoi_type_raises(self):
309+
"""split_area rejects AOI types that are not dict, Polygon, or MultiPolygon."""
310+
with pytest.raises(JobSplittingFailure, match="Expected a bounding-box dict"):
311+
split_area("not_a_geometry", projection="EPSG:4326", tile_size=1.0)

0 commit comments

Comments
 (0)