Skip to content

Commit

Permalink
Improved test_get_cloud_uris to test for a GALEX observation
Browse files Browse the repository at this point in the history
  • Loading branch information
jaymedina committed Jul 12, 2023
1 parent 8d87d84 commit 0a30aa2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
24 changes: 14 additions & 10 deletions astroquery/mast/tests/test_mast_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,28 +405,32 @@ def test_get_cloud_uri(self):

def test_get_cloud_uris(self):
pytest.importorskip("boto3")
test_obs_id = '25568122'
test_obs_ids = ["25568122", "31411"]

# get a product list
products = mast.Observations.get_product_list(test_obs_id)[24:]
for test_obs_id in test_obs_ids:

assert len(products) > 0, (f'No products found for OBSID {test_obs_id}. '
'Unable to move forward with getting URIs from the cloud.')
# get a product list
index = 24 if test_obs_id == "25568122" else 0
products = mast.Observations.get_product_list(test_obs_id)[index:]

# enable access to public AWS S3 bucket
mast.Observations.enable_cloud_dataset()
assert len(products) > 0, (f'No products found for OBSID {test_obs_id}.'
'Unable to move forward with getting URIs from the cloud.')

# get uris
uris = mast.Observations.get_cloud_uris(products)
# enable access to public AWS S3 bucket
mast.Observations.enable_cloud_dataset()

assert len(uris) > 0, f'Products for OBSID {test_obs_id} were not found in the cloud.'
# get uris
uris = mast.Observations.get_cloud_uris(products)

assert len(uris) > 0, f'Products for OBSID {test_obs_id} were not found in the cloud.'

######################
# CatalogClass tests #
######################

# query functions
def test_catalogs_query_region_async(self):

responses = mast.Catalogs.query_region_async("158.47924 -7.30962", catalog="Galex")
assert isinstance(responses, list)

Expand Down
4 changes: 0 additions & 4 deletions astroquery/mast/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,3 @@ def _split_list_into_chunks(input_list, chunk_size):
"""Helper function for `mast_relative_path`."""
for idx in range(0, len(input_list), chunk_size):
yield input_list[idx:idx + chunk_size]

Check warning on line 202 in astroquery/mast/utils.py

View check run for this annotation

Codecov / codecov/patch

astroquery/mast/utils.py#L201-L202

Added lines #L201 - L202 were not covered by tests


def mast_path_strip(path, mission):
"""Helper function to"""

0 comments on commit 0a30aa2

Please sign in to comment.