Skip to content

Commit

Permalink
tests: Use local files for GFZ auto update checks
Browse files Browse the repository at this point in the history
We don't (yet) ship the GFZ data files, so the normal tests will fail
because the files are not found. Uses the short test files instead so
that the checks can complete.
  • Loading branch information
st-bender committed Feb 15, 2024
1 parent fae0efc commit 4bd480b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/test_gfz.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,17 @@ def test_auto_update(mocker, tmpdir):
update_gfz(gfzpath_30d=os.path.join(tmpdir, "foo.dat"))
requests.get.assert_called_with(GFZ_URL_30D, stream=True)
# Should update the last-5-year data
gfz_daily(update=True, update_interval="1d")
gfz_daily(
gfzpath_all=GFZ_PATH_ALL, gfzpath_30d=GFZ_PATH_30D,
update=True, update_interval="1d",
)
requests.get.assert_called_with(GFZ_URL_30D, stream=True)
_assert_age(GFZ_PATH_30D, "10d")
with pytest.warns(UserWarning):
gfz_daily(update=False, update_interval="0h")
gfz_daily(
gfzpath_all=GFZ_PATH_ALL, gfzpath_30d=GFZ_PATH_30D,
update=False, update_interval="0h",
)


def test_not_avail(mocker, tmpdir):
Expand Down

0 comments on commit 4bd480b

Please sign in to comment.