diff --git a/tests/integration/test_cloud_download.py b/tests/integration/test_cloud_download.py index 4ecc3137..63a05b93 100644 --- a/tests/integration/test_cloud_download.py +++ b/tests/integration/test_cloud_download.py @@ -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))