Skip to content

Commit 55fc7f9

Browse files
Add ValueError test
1 parent 696418f commit 55fc7f9

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

tests/test_utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,3 +299,10 @@ def test_crop(self, synthetic_dataarray, crop_geometry):
299299
assert da_crop.azimuth.size == 6
300300
assert da_crop.range.size == 5
301301
assert da_crop.time.size == da.time.size
302+
303+
def test_crop_wrong_dimname(self, synthetic_dataarray, crop_geometry):
304+
da = synthetic_dataarray
305+
da = da.rename({"azimuth": "az"}) # rename azimuth to a wrong name
306+
geom = crop_geometry
307+
with pytest.raises(ValueError):
308+
da_crop = crop(da, geom)

0 commit comments

Comments
 (0)