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 11, 2023
1 parent 0a5f0bd commit 8438d9e
Showing 1 changed file with 14 additions and 10 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,22 +405,26 @@ 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.')

# enable access to public AWS S3 bucket
mast.Observations.enable_cloud_dataset()

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


######################
# CatalogClass tests #
######################
Expand Down

0 comments on commit 8438d9e

Please sign in to comment.