Skip to content

Commit 2326136

Browse files
committed
implement tests
1 parent 10bde0f commit 2326136

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

astroquery/simbad/tests/test_simbad.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from ... import simbad
1111
from ...utils.testing_tools import MockResponse
1212
from ...utils import commons
13+
from ...query import AstroQuery
1314
from ...exceptions import TableParseError
1415
from .test_simbad_remote import multicoords
1516

@@ -118,12 +119,15 @@ def test_get_frame_coordinates(coordinates, expected_frame):
118119

119120

120121
def test_parse_result():
121-
result1 = simbad.core.Simbad._parse_result(
122+
sb = simbad.core.Simbad()
123+
# need _last_query to be defined
124+
sb._last_query = AstroQuery('GET', 'http://dummy')
125+
result1 = sb._parse_result(
122126
MockResponseSimbad('query id '), simbad.core.SimbadVOTableResult)
123127
assert isinstance(result1, Table)
124128
with pytest.raises(TableParseError) as ex:
125-
simbad.core.Simbad._parse_result(MockResponseSimbad('query error '),
126-
simbad.core.SimbadVOTableResult)
129+
sb._parse_result(MockResponseSimbad('query error '),
130+
simbad.core.SimbadVOTableResult)
127131
assert str(ex.value) == ('Failed to parse SIMBAD result! The raw response '
128132
'can be found in self.last_response, and the '
129133
'error in self.last_table_parse_error. '

0 commit comments

Comments
 (0)