Skip to content

Commit 80f5f1c

Browse files
committed
And fix the tests to match last changes.
1 parent 3d70a25 commit 80f5f1c

File tree

2 files changed

+8
-28
lines changed

2 files changed

+8
-28
lines changed

astroquery/jplhorizons/tests/test_jplhorizons.py

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
DATA_FILES = {'ephemerides': 'ceres_ephemerides.txt',
1717
'elements': 'ceres_elements.txt',
1818
'vectors': 'ceres_vectors.txt',
19-
'"1935 UZ;"': 'no_H.txt'}
19+
'"1935 UZ"': 'no_H.txt'}
2020

2121

2222
def data_path(filename):
@@ -27,7 +27,7 @@ def data_path(filename):
2727
# monkeypatch replacement request function
2828
def nonremote_request(self, request_type, url, **kwargs):
2929

30-
if kwargs['params']['COMMAND'] == '"Ceres;"':
30+
if kwargs['params']['COMMAND'] == '"Ceres"':
3131
# pick DATA_FILE based on query type
3232
query_type = {'OBSERVER': 'ephemerides',
3333
'ELEMENTS': 'elements',
@@ -182,7 +182,7 @@ def test_elements_query_payload():
182182
('EPHEM_TYPE', 'ELEMENTS'),
183183
('MAKE_EPHEM', 'YES'),
184184
('OUT_UNITS', 'AU-D'),
185-
('COMMAND', '"Ceres;"'),
185+
('COMMAND', '"Ceres"'),
186186
('CENTER', "'500@10'"),
187187
('CSV_FORMAT', 'YES'),
188188
('ELEM_LABELS', 'YES'),
@@ -202,7 +202,7 @@ def test_vectors_query_payload():
202202
('format', 'text'),
203203
('EPHEM_TYPE', 'VECTORS'),
204204
('OUT_UNITS', 'AU-D'),
205-
('COMMAND', '"Ceres;"'),
205+
('COMMAND', '"Ceres"'),
206206
('CENTER', "'500@10'"),
207207
('CSV_FORMAT', '"YES"'),
208208
('REF_PLANE', 'ECLIPTIC'),
@@ -219,18 +219,3 @@ def test_no_H(patch_request):
219219
"""testing missing H value (also applies for G, M1, k1, M2, k2)"""
220220
res = jplhorizons.Horizons(id='1935 UZ').ephemerides()[0]
221221
assert 'H' not in res
222-
223-
224-
def test_id_type_deprecation():
225-
"""Test deprecation warnings based on issue 1742.
226-
227-
Remove when id_type behavior is changed.
228-
229-
https://github.com/astropy/astroquery/pull/1742
230-
231-
"""
232-
with pytest.warns(AstropyDeprecationWarning):
233-
res = jplhorizons.Horizons(id='Ceres')
234-
235-
with pytest.warns(AstropyDeprecationWarning):
236-
res = jplhorizons.Horizons(id='Ceres', id_type='majorbody')

astroquery/jplhorizons/tests/test_jplhorizons_remote.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -263,18 +263,14 @@ def test_vectors_query_raw(self):
263263
assert len(res) >= 6412
264264

265265
def test_unknownobject(self):
266-
try:
266+
with pytest.raises(ValueError):
267267
jplhorizons.Horizons(id='spamspamspameggsspam', location='500',
268-
id_type='', epochs=2451544.5).ephemerides()
269-
except ValueError:
270-
pass
268+
epochs=2451544.5).ephemerides()
271269

272270
def test_multipleobjects(self):
273-
try:
271+
with pytest.raises(ValueError):
274272
jplhorizons.Horizons(id='73P', location='500', id_type='smallbody',
275273
epochs=2451544.5).ephemerides()
276-
except ValueError:
277-
pass
278274

279275
def test_uri(self):
280276
target = jplhorizons.Horizons(id='3552', location='500',
@@ -329,8 +325,7 @@ def test_majorbody(self):
329325
quantities = ('1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,'
330326
'21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,'
331327
'38,39,40,41,42,43')
332-
target = jplhorizons.Horizons(id='301', location='688', epochs=epochs,
333-
id_type='')
328+
target = jplhorizons.Horizons(id='301', location='688', epochs=epochs)
334329
eph = target.ephemerides(quantities=quantities)
335330
assert len(eph) == 2
336331

0 commit comments

Comments
 (0)