Skip to content

Commit

Permalink
HARMONY-1714: Add tests for get_filename_from_url
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnyinverso committed Mar 22, 2024
1 parent b5b0742 commit 5fff0f2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,16 @@ def side_effect_for_get_json(extra_links) -> List[str]:

return [status_running1, status_running2, status_paused, status_resumed, status_successful, status_successful]

def test_get_file_name_non_staged_link():
client = Client(should_validate_auth=False)
actual_file_name = client.get_filename_from_url('https://harmony.earthdata.nasa.gov/service-results/staging-bucket/a36337f4-3e4b-4x57-ba26-a484a5877f3a/1047412/C1254854453-LARC_CLOUD_merged.nc4')
assert actual_file_name == '1047412_C1254854453-LARC_CLOUD_merged.nc4'

def test_get_file_name_staged_link():
client = Client(should_validate_auth=False)
actual_file_name = client.get_filename_from_url('https://harmony.earthdata.nasa.gov/service-results/test-data/C1261703151-EEDTEST/ATL08_20181014001049_02350102_006_02.h5')
assert actual_file_name == 'ATL08_20181014001049_02350102_006_02.h5'

@pytest.mark.parametrize('link_type', [LinkType.http, LinkType.https, LinkType.s3])
def test_iterator(link_type, mocker):
extra_links = extra_links_for_iteration(link_type.value)
Expand Down

0 comments on commit 5fff0f2

Please sign in to comment.