Skip to content

Commit 56f53a1

Browse files
committed
Update offensive value for test_get_country_geometries_fail
1 parent 5ff2806 commit 56f53a1

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

climada/util/test/test_coordinates.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,10 +1702,24 @@ def test_get_country_geometries_all_pass(self):
17021702

17031703
def test_get_country_geometries_fail(self):
17041704
"""get_country_geometries with offensive parameters"""
1705-
with self.assertRaises(ValueError):
1706-
u_coord.get_country_geometries(extent=(-20, 350, 0, 0))
1707-
with self.assertRaises(ValueError):
1705+
with self.assertRaises(ValueError) as cm:
1706+
u_coord.get_country_geometries(extent=(-20, 540, 0, 0))
1707+
self.assertEqual(
1708+
"Input lat and lon coordinates do not seem to correspond"
1709+
" to geographic coordinates in degrees. This can be because"
1710+
" total extents are > 180 for lat or > 360 for lon, lat coordinates"
1711+
" are outside of -90<lat<90, or lon coordinates are outside of -540<lon<540."
1712+
" If you use degree values outside of these ranges,"
1713+
" please shift the coordinates to the valid ranges.",
1714+
str(cm.exception),
1715+
)
1716+
with self.assertRaises(ValueError) as cm:
17081717
u_coord.get_country_geometries(extent=(340, -20, 0, 0))
1718+
self.assertEqual(
1719+
"longitude extent at the left (340) is larger "
1720+
"than longitude extent at the right (-20)",
1721+
str(cm.exception),
1722+
)
17091723

17101724
def test_country_code_pass(self):
17111725
"""Test set_region_id"""

0 commit comments

Comments
 (0)