Skip to content

Commit 52e25dd

Browse files
committed
Handle VizierList in post_mockreturn
1 parent 7a0d165 commit 52e25dd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

astroquery/vizier/tests/test_vizier.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from astropy.table import Table
77
import astropy.units as u
88
import six
9-
from six.moves import urllib_parse as urlparse
109
from ... import vizier
1110
from ...utils import commons
1211
from ...utils.testing_tools import MockResponse
@@ -43,7 +42,13 @@ def post_mockreturn(self, method, url, data=None, timeout=10, files=None,
4342
if isinstance(data, dict):
4443
datad = data
4544
else:
46-
datad = dict([urlparse.parse_qsl(d)[0] for d in data.split('\n')])
45+
datad = {}
46+
for line in data.split('\n'):
47+
if '=' in line:
48+
key, value = line.split('=', maxsplit=1)
49+
datad[key.strip()] = value.strip()
50+
else:
51+
datad[line] = None
4752
if '-source' in datad:
4853
# a request for the actual data
4954
filename = data_path(VO_DATA[datad['-source']])

0 commit comments

Comments
 (0)