Skip to content

Commit

Permalink
Replace proj dict mocks with is_geostationary attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
lahtinep committed Apr 19, 2024
1 parent 8b3bf3a commit 643b5c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trollflow2/tests/test_trollflow2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1119,14 +1119,14 @@ def test_coverage(self):
mock.patch('trollflow2.plugins.get_geostationary_bounding_box'):

boundary.return_value.contour_poly.intersection.return_value.area.return_value = 0.02
adef = mock.MagicMock(proj_dict={'proj': 'stere'})
adef = mock.MagicMock(is_geostationary=False)
adef.boundary.return_value.contour_poly.intersection.return_value.area.return_value = 0.02
adef.boundary.return_value.contour_poly.area.return_value = 0.2
start_time = dt.datetime(2019, 4, 7, 20, 8)
res = _get_sunlight_coverage(adef, start_time)
np.testing.assert_allclose(res, 0.1)
boundary.assert_not_called()
adef = mock.MagicMock(proj_dict={'proj': 'geos'})
adef = mock.MagicMock(is_geostationary=True)
res = _get_sunlight_coverage(adef, start_time)
boundary.assert_called()

Expand Down

0 comments on commit 643b5c7

Please sign in to comment.