Skip to content

Commit

Permalink
Improve test by checking for iso.xml files and filesize
Browse files Browse the repository at this point in the history
Correct test should have been to check for files without 'processed_' prefix. Also checking the .iso.xml metadata files and the filesize for good measure now.
  • Loading branch information
weiji14 committed Aug 27, 2024
1 parent db96705 commit 4fbbb98
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion icepyx/tests/test_behind_NSIDC_API_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,12 @@ def test_download_granules_without_subsetting(reg, session, capsys):
assert int(reg.granules.orderIDs[0]) >= 5_000_000_000_000

reg.download_granules(path=path)
assert len(glob.glob(pathname=f"{path}/processed_ATL06_201902*.h5")) == 3
assert len(glob.glob(pathname=f"{path}/ATL06_201902*.iso.xml")) == 3
h5_paths = glob.glob(pathname=f"{path}/ATL06_201902*.h5")
assert len(h5_paths) == 3
# check that the max extent of the downloaded granules isn't subsetted
assert [os.path.getsize(filename=p) for p in h5_paths] == [
65120027, # 62.1 MiB
53228429, # 50.8 MiB
49749227, # 47.4 MiB
]

0 comments on commit 4fbbb98

Please sign in to comment.