Skip to content

Commit d2e0300

Browse files
committed
Added data for tests
1 parent 1c318f4 commit d2e0300

File tree

5 files changed

+2294
-5
lines changed

5 files changed

+2294
-5
lines changed

astroquery/imcce/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ class Conf(_config.ConfigNamespace):
1717
"""
1818

1919
# server settings
20+
obs_codes_url = _config.ConfigItem(
21+
'http://www.minorplanetcenter.net/iau/lists/ObsCodes.html',
22+
'IAU observatory codes')
2023
ephemcc_server = _config.ConfigItem(
2124
'http://vo.imcce.fr/webservices/miriade/ephemcc_query.php',
2225
'IMCCE/Miriade.ephemcc base server')

astroquery/imcce/core.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def get_observatory_codes(self, restr=None):
5555
Examples
5656
--------
5757
>>> from astroquery.imcce import Miriade
58-
>>> obs = Miriade.get_observatory_codes('Green') # doctest: +REMOTE_DATA
58+
>>> obs = Miriade.get_observatory_codes(restr='Green') # doctest: +REMOTE_DATA
5959
>>> print(obs) # doctest: +REMOTE_DATA
6060
<Table length=8>
6161
Code Long. cos sin Name
@@ -70,9 +70,12 @@ def get_observatory_codes(self, restr=None):
7070
Q54 147.28772 0.73929 -0.671278 Harlingten Telescope, Greenhill Observatory
7171
Z54 358.92214 0.623422 0.779306 Greenmoor Observatory, Woodcote
7272
"""
73-
obs_codes_url = 'http://www.minorplanetcenter.net/iau/lists/ObsCodes.html'
73+
URL = conf.obs_codes_url
74+
TIMEOUT = conf.timeout
75+
76+
response = self._request('GET', URL, timeout=TIMEOUT)
7477
if not hasattr(self, '_observatory_codes'):
75-
self._observatory_codes = ascii.read(obs_codes_url,
78+
self._observatory_codes = ascii.read(response.text,
7679
format='fixed_width',
7780
header_start=1,
7881
data_start=2,

0 commit comments

Comments
 (0)