Skip to content

Commit

Permalink
Add test for multi-file download
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbourbeau committed Dec 4, 2023
1 parent 4de8af6 commit 11bb43b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/integration/test_cloud_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,13 @@ def test_earthaccess_can_download_cloud_collection_granules(daac):
f"Warning: {concept_id} downloaded size {total_mb_downloaded}MB is "
f"different from the size reported by CMR: {total_size_cmr}MB"
)


def test_multi_file_granule(tmp_path):
# Ensure granules that contain multiple files are handled correctly
granules = earthaccess.search_data(short_name="HLSL30", count=1)
assert len(granules) == 1
urls = granules[0].data_links()
assert len(urls) > 1
files = earthaccess.download(granules, str(tmp_path))
assert set(map(os.path.basename, urls)) == set(map(os.path.basename, files))

0 comments on commit 11bb43b

Please sign in to comment.