Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix in the cadc module in anticipation of coming changes to the servers #2326

Merged
merged 5 commits into from
Mar 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions astroquery/cadc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,10 @@ def get_data_urls(self, query_result, include_auxiliaries=False):
urlencode({'ID': pid_sublist,
'REQUEST': 'downloads-only'}, True)))
for service_def in datalink:
if service_def.semantics == 'http://www.openadc.org/caom2#pkg':
# pkg is an alternative for downloading multiple
if service_def.semantics in ['http://www.opencadc.org/caom2#pkg', '#package']:
# TODO http://www.openadc.org/caom2#pkg has been replaced
# by "package". Removed it after CADC rolls out the change
# package is an alternative for downloading multiple
# data files in a tar file as an alternative to separate
# downloads. It doesn't make much sense in this case so
# filter it out.
Expand Down
9 changes: 6 additions & 3 deletions astroquery/cadc/tests/test_cadctap.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,13 @@ class Result:
file3.semantics = '#preview'
file3.access_url = 'https://get.your.data/previewpath'
# add the package file that should be filtered out
package_file_old = Mock()
package_file_old.semantics = 'http://www.opencadc.org/caom2#pkg'
package_file = Mock()
package_file.semantics = 'http://www.openadc.org/caom2#pkg'
result = [file1, file2, file3, package_file]
with patch('pyvo.dal.adhoc.DatalinkResults.from_result_url') as dl_results_mock:
package_file.semantics = '#package'
result = [file1, file2, file3, package_file_old, package_file]
with patch('pyvo.dal.adhoc.DatalinkResults.from_result_url') as \
dl_results_mock:
dl_results_mock.return_value = result
cadc = Cadc()
cadc._request = get # mock the request
Expand Down
3 changes: 3 additions & 0 deletions astroquery/cadc/tests/test_cadctap_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def test_authsession(self):

@pytest.mark.skipif(one_test, reason='One test mode')
@pytest.mark.skipif(not pyvo_OK, reason='not pyvo_OK')
@pytest.mark.xfail(reason='#2325')
def test_get_images(self):
cadc = Cadc()
coords = '08h45m07.5s +54d18m00s'
Expand Down Expand Up @@ -253,6 +254,7 @@ def test_get_images_against_AS(self):

@pytest.mark.skipif(one_test, reason='One test mode')
@pytest.mark.skipif(not pyvo_OK, reason='not pyvo_OK')
@pytest.mark.xfail(reason='#2325')
def test_get_images_async(self):
cadc = Cadc()
coords = '01h45m07.5s +23d18m00s'
Expand Down Expand Up @@ -313,6 +315,7 @@ def test_list_tables(self):
reason='Requires real CADC certificate (CADC_CERT '
'environment variable)')
@pytest.mark.skipif(not pyvo_OK, reason='not pyvo_OK')
@pytest.mark.xfail(reason='#2325')
def test_list_jobs(self):
cadc = Cadc()
cadc.login(certificate_file=os.environ['CADC_CERT'])
Expand Down