Skip to content

Commit 3f75c3b

Browse files
committed
Add test case, remove query_criteria call from test
1 parent 2651b5f commit 3f75c3b

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

astroquery/mast/tests/test_mast_remote.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -381,13 +381,21 @@ def test_observations_get_product_list_tess_tica(self, caplog):
381381
assert (np.char.find(prods['obs_id'], '429031146') != -1).all()
382382

383383
def test_observations_get_unique_product_list(self, caplog):
384-
obs = Observations.query_criteria(obs_collection='HST',
385-
filters='F606W',
386-
instrument_name='ACS/WFC',
387-
proposal_id=['12062'],
388-
dataRights='PUBLIC')
389-
products = Observations.get_product_list(obs)
390-
unique_products = Observations.get_unique_product_list(obs)
384+
# Check that no rows are filtered out when all products are unique
385+
obsids = ['24832668']
386+
products = Observations.get_product_list(obsids)
387+
unique_products = Observations.get_unique_product_list(obsids)
388+
389+
# Should have the same length
390+
assert len(products) == len(unique_products)
391+
# No INFO messages should be logged
392+
with caplog.at_level('INFO', logger='astroquery'):
393+
assert caplog.text == ''
394+
395+
# Check that rows are filtered out when products are not unique
396+
obsids.append('26421364')
397+
products = Observations.get_product_list(obsids)
398+
unique_products = Observations.get_unique_product_list(obsids)
391399

392400
# Unique product list should have fewer rows
393401
assert len(products) > len(unique_products)

0 commit comments

Comments
 (0)