Skip to content

Commit d40a486

Browse files
keflavichbsipocz
authored andcommitted
fix a few more tests
1 parent ceecde0 commit d40a486

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

astroquery/splatalogue/tests/test_splatalogue.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,24 @@ def test_load_species_table():
4646

4747
# regression test: get_query_payload should work (#308)
4848
def test_get_payload():
49-
q = splatalogue.core.Splatalogue.query_lines_async(min_frequency=1 * u.GHz,
49+
payload = splatalogue.core.Splatalogue.query_lines_async(min_frequency=1 * u.GHz,
5050
max_frequency=10 * u.GHz,
5151
get_query_payload=True)
52-
assert q['body']["userInputFrequenciesFrom"] == [1.0]
53-
assert q['body']["userInputFrequenciesTo"] == [10.0]
52+
payload = json.loads(payload['body'])
53+
assert payload["userInputFrequenciesFrom"] == [1.0]
54+
assert payload["userInputFrequenciesTo"] == [10.0]
5455

5556

5657
# regression test: line lists should ask for only one line list, not all
5758
def test_line_lists():
58-
q = splatalogue.core.Splatalogue.query_lines_async(min_frequency=1 * u.GHz,
59+
payload = splatalogue.core.Splatalogue.query_lines_async(min_frequency=1 * u.GHz,
5960
max_frequency=10 * u.GHz,
6061
line_lists=['JPL'],
6162
get_query_payload=True)
62-
assert q['body']['lineListDisplayCDMSJPL']
63-
assert not q['body']['lineListDisplaySLAIM']
63+
payload = json.loads(payload['body'])
64+
assert payload['lineListDisplayJPL']
65+
assert not payload['lineListDisplaySLAIM']
66+
assert not payload['lineListDisplayCDMS']
6467

6568

6669
# regression test: raise an exception if a string is passed to line_lists

0 commit comments

Comments
 (0)