From 1ce2697638381aabac921a5232d4d43f072638ba Mon Sep 17 00:00:00 2001 From: Jennifer Medina Date: Tue, 11 Jul 2023 19:16:03 -0400 Subject: [PATCH] Improved test_get_cloud_uris to test for a GALEX observation --- astroquery/mast/tests/test_mast_remote.py | 24 +++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/astroquery/mast/tests/test_mast_remote.py b/astroquery/mast/tests/test_mast_remote.py index ba551f544f..3122f2e820 100644 --- a/astroquery/mast/tests/test_mast_remote.py +++ b/astroquery/mast/tests/test_mast_remote.py @@ -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 # ######################