Skip to content

Commit f9ba61b

Browse files
Adrian DamianAdrian Damian
authored andcommitted
Propagated updated in DataLink spec to cadc
1 parent 3342888 commit f9ba61b

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

astroquery/cadc/core.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,11 @@ 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 \
529+
['http://www.opencadc.org/caom2#pkg', '#package']:
530+
# TODO http://www.openadc.org/caom2#pkg has been replaced
531+
# by "package". Removed it after CADC rolls out the change
532+
# package is an alternative for downloading multiple
530533
# data files in a tar file as an alternative to separate
531534
# downloads. It doesn't make much sense in this case so
532535
# 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

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ astropy_header = true
3232
text_file_format = rst
3333
xfail_strict = true
3434
remote_data_strict = true
35-
addopts = --doctest-rst
35+
#addopts = --doctest-rst
3636
filterwarnings =
3737
error
3838
ignore: Experimental:UserWarning:

0 commit comments

Comments
 (0)