From 7c6499170766419139d1757380db1fe819e29e9b Mon Sep 17 00:00:00 2001 From: Trey Stafford Date: Wed, 30 Oct 2024 16:28:20 -0600 Subject: [PATCH] Test code branch indicated as a "dev goal" in comment --- icepyx/core/spatial.py | 1 - icepyx/tests/unit/test_spatial.py | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/icepyx/core/spatial.py b/icepyx/core/spatial.py index dddcc0c8..7806fdb1 100644 --- a/icepyx/core/spatial.py +++ b/icepyx/core/spatial.py @@ -71,7 +71,6 @@ def geodataframe( """ # If extent_type is a polygon AND from a file, create a geopandas geodataframe from it - # DevGoal: Currently this branch isn't tested... if file is True: if extent_type == "polygon": return gpd.read_file(spatial_extent) diff --git a/icepyx/tests/unit/test_spatial.py b/icepyx/tests/unit/test_spatial.py index c1dc1d83..f27f617e 100644 --- a/icepyx/tests/unit/test_spatial.py +++ b/icepyx/tests/unit/test_spatial.py @@ -431,6 +431,11 @@ def test_gdf_from_list_tuples(): assert obs.geometry[0].equals(exp.geometry[0]) +def test_gdf_raises_error_bounding_box_file(): + with pytest.raises(TypeError): + spat.geodataframe("bounding_box", "/fake/file/somewhere/polygon.shp") + + # Potential tests to include once multipolygon and complex polygons are handled # def test_gdf_from_strpoly_one_simple():