Skip to content

Commit ff99717

Browse files
committed
cloud uri tests now passing with products found
1 parent 21eb076 commit ff99717

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

astroquery/mast/tests/test_mast_remote.py

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,21 +294,37 @@ def test_observations_download_file(self, tmpdir):
294294
result = mast.Observations.download_file(uri)
295295
assert result == ('COMPLETE', None, None)
296296

297-
def test_get_cloud_uri(self)
298-
test_obs_id = '44308'
297+
def test_get_cloud_uri(self):
298+
test_obs_id = '25568122'
299299

300300
# get a product list
301-
product = mast.Observations.get_product_list(test_obs_id)
301+
product = mast.Observations.get_product_list(test_obs_id)[24]
302302

303-
assert len(product) > 0, 'No products found for OBSID {}. Unable to move forward with getting URIs from the cloud.'.format(test_obs_id)
303+
assert len(product) > 0, f'No product found for OBSID {test_obs_id}. Unable to move forward with getting URIs from the cloud.'
304304

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

308308
# get uri
309-
mast.Observations.get_cloud_uri(product)
309+
uri = mast.Observations.get_cloud_uri(product)
310310

311-
#def test_get_cloud_uris(self, )
311+
assert len(uri) > 0, f'Product for OBSID {test_obs_id} was not found in the cloud.'
312+
313+
def test_get_cloud_uris(self):
314+
test_obs_id = '25568122'
315+
316+
# get a product list
317+
products = mast.Observations.get_product_list(test_obs_id)[24:]
318+
319+
assert len(products) > 0, f'No products found for OBSID {test_obs_id}. Unable to move forward with getting URIs from the cloud.'
320+
321+
# enable access to public AWS S3 bucket
322+
mast.Observations.enable_cloud_dataset()
323+
324+
# get uris
325+
uris = mast.Observations.get_cloud_uris(products)
326+
327+
assert len(uris) > 0, f'Products for OBSID {test_obs_id} were not found in the cloud.'
312328

313329
######################
314330
# CatalogClass tests #

0 commit comments

Comments
 (0)