|
1 | 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
|
2 | 2 | """
|
3 | 3 | =============
|
4 |
| -CadcClass TAP plus |
| 4 | +CadcClass TAP |
5 | 5 | =============
|
6 | 6 |
|
7 | 7 | """
|
|
20 | 20 | from astropy import units as u
|
21 | 21 | import pytest
|
22 | 22 | import requests
|
| 23 | +import warnings |
23 | 24 |
|
24 | 25 | from pyvo.auth import securitymethods
|
25 | 26 | from astroquery.cadc import Cadc, conf
|
26 | 27 | import astroquery.cadc.core as cadc_core
|
27 | 28 |
|
28 | 29 | from unittest.mock import Mock, patch, PropertyMock
|
29 | 30 |
|
| 31 | +try: |
| 32 | + # workaround for https://github.com/astropy/astroquery/issues/2523 to support bs4<4.11 |
| 33 | + from bs4.builder import XMLParsedAsHTMLWarning |
| 34 | +except ImportError: |
| 35 | + XMLParsedAsHTMLWarning = None |
| 36 | + |
30 | 37 |
|
31 | 38 | def data_path(filename):
|
32 | 39 | data_dir = os.path.join(os.path.dirname(__file__), 'data')
|
@@ -191,9 +198,14 @@ def raise_for_status(self):
|
191 | 198 | with patch.object(cadc_core.requests, 'get', get):
|
192 | 199 | cadc_core.get_access_url.caps = {}
|
193 | 200 | assert 'http://my.org/mytap' == cadc_core.get_access_url('mytap')
|
194 |
| - assert 'https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/argus/tables' == \ |
195 |
| - cadc_core.get_access_url('mytap', |
196 |
| - 'ivo://ivoa.net/std/VOSI#tables-1.1') |
| 201 | + |
| 202 | + # Remove this filter when https://github.com/astropy/astroquery/issues/2523 is fixed |
| 203 | + with warnings.catch_warnings(): |
| 204 | + if XMLParsedAsHTMLWarning: |
| 205 | + warnings.filterwarnings("ignore", category=XMLParsedAsHTMLWarning) |
| 206 | + |
| 207 | + assert 'https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/argus/tables' == \ |
| 208 | + cadc_core.get_access_url('mytap', 'ivo://ivoa.net/std/VOSI#tables-1.1') |
197 | 209 |
|
198 | 210 |
|
199 | 211 | @patch('astroquery.cadc.core.get_access_url',
|
|
0 commit comments