Skip to content

Commit 9042495

Browse files
committed
generalize assert
1 parent 7a581b2 commit 9042495

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

climada/util/test/test_coordinates.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,21 @@ def test_get_country_geometries_extent_pass(self):
198198
))
199199

200200
self.assertIsInstance(res, geopandas.geodataframe.GeoDataFrame)
201-
self.assertAlmostEqual(res.bounds.iloc[0,0], -11.800084333105298)
202201
self.assertTrue(
203-
np.allclose(res.bounds.iloc[1,1], lat[0])
202+
np.allclose(res.bounds.iloc[1, 1], lat[0])
203+
)
204+
self.assertTrue(
205+
np.allclose(res.bounds.iloc[0, 0], -11.800084333105298) or
206+
np.allclose(res.bounds.iloc[1, 0], -11.800084333105298)
207+
)
208+
self.assertTrue(
209+
np.allclose(res.bounds.iloc[0, 2], np.max(lon)) or
210+
np.allclose(res.bounds.iloc[1, 2], np.max(lon))
211+
)
212+
self.assertTrue(
213+
np.allclose(res.bounds.iloc[0, 3], np.max(lat)) or
214+
np.allclose(res.bounds.iloc[1, 3], np.max(lat))
204215
)
205-
self.assertAlmostEqual(res.bounds.iloc[0,2], np.max(lon))
206-
self.assertAlmostEqual(res.bounds.iloc[0,3], np.max(lat))
207216

208217
def test_get_country_geometries_all_pass(self):
209218
"""get_country_geometries with no countries or extent; i.e. the whole

0 commit comments

Comments
 (0)