Пример #1
0
 def test_unsupported_years(self):
     with pytest.raises(InvalidInputRange) as ex:
         _ = gh.ssebopeta_byloc((GEOM.centroid.x, GEOM.centroid.y),
                                dates=[2010, 2014, 2021])
     assert "2020" in str(ex.value)
Пример #2
0
 def test_unsupported_dates(self):
     with pytest.raises(InvalidInputRange) as ex:
         _ = gh.ssebopeta_byloc((GEOM.centroid.x, GEOM.centroid.y),
                                dates=("1990-01-01", "1990-01-05"))
     assert "2000" in str(ex.value)
Пример #3
0
 def test_invalid_coords(self):
     with pytest.raises(InvalidInputType) as ex:
         _ = gh.ssebopeta_byloc(GEOM.centroid.x, dates=self.dates)
     assert "(lon, lat)" in str(ex.value)
Пример #4
0
 def test_invalid_dates_tuple(self):
     with pytest.raises(InvalidInputType) as ex:
         _ = gh.ssebopeta_byloc((GEOM.centroid.x, GEOM.centroid.y),
                                dates=("2000-01-01"))
     assert "(start, end)" in str(ex.value)
Пример #5
0
 def test_loc(self):
     eta = gh.ssebopeta_byloc((GEOM.centroid.x, GEOM.centroid.y),
                              dates=self.dates)
     assert abs(eta.mean() - 0.575) < SMALL