Skip to content

Commit 44fc1a8

Browse files
authored
Merge pull request #2326 from andamian/fixcadc
Fix in the cadc module in anticipation of coming changes to the servers
2 parents 97f6f30 + 800006d commit 44fc1a8

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

astroquery/cadc/core.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,10 @@ def get_data_urls(self, query_result, include_auxiliaries=False):
525525
urlencode({'ID': pid_sublist,
526526
'REQUEST': 'downloads-only'}, True)))
527527
for service_def in datalink:
528-
if service_def.semantics == 'http://www.openadc.org/caom2#pkg':
529-
# pkg is an alternative for downloading multiple
528+
if service_def.semantics in ['http://www.opencadc.org/caom2#pkg', '#package']:
529+
# TODO http://www.openadc.org/caom2#pkg has been replaced
530+
# by "package". Removed it after CADC rolls out the change
531+
# package is an alternative for downloading multiple
530532
# data files in a tar file as an alternative to separate
531533
# downloads. It doesn't make much sense in this case so
532534
# filter it out.

astroquery/cadc/tests/test_cadctap.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,13 @@ class Result:
230230
file3.semantics = '#preview'
231231
file3.access_url = 'https://get.your.data/previewpath'
232232
# add the package file that should be filtered out
233+
package_file_old = Mock()
234+
package_file_old.semantics = 'http://www.opencadc.org/caom2#pkg'
233235
package_file = Mock()
234-
package_file.semantics = 'http://www.openadc.org/caom2#pkg'
235-
result = [file1, file2, file3, package_file]
236-
with patch('pyvo.dal.adhoc.DatalinkResults.from_result_url') as dl_results_mock:
236+
package_file.semantics = '#package'
237+
result = [file1, file2, file3, package_file_old, package_file]
238+
with patch('pyvo.dal.adhoc.DatalinkResults.from_result_url') as \
239+
dl_results_mock:
237240
dl_results_mock.return_value = result
238241
cadc = Cadc()
239242
cadc._request = get # mock the request

astroquery/cadc/tests/test_cadctap_remote.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ def test_authsession(self):
206206

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

254255
@pytest.mark.skipif(one_test, reason='One test mode')
255256
@pytest.mark.skipif(not pyvo_OK, reason='not pyvo_OK')
257+
@pytest.mark.xfail(reason='#2325')
256258
def test_get_images_async(self):
257259
cadc = Cadc()
258260
coords = '01h45m07.5s +23d18m00s'
@@ -313,6 +315,7 @@ def test_list_tables(self):
313315
reason='Requires real CADC certificate (CADC_CERT '
314316
'environment variable)')
315317
@pytest.mark.skipif(not pyvo_OK, reason='not pyvo_OK')
318+
@pytest.mark.xfail(reason='#2325')
316319
def test_list_jobs(self):
317320
cadc = Cadc()
318321
cadc.login(certificate_file=os.environ['CADC_CERT'])

0 commit comments

Comments
 (0)