Skip to content

Commit 66fe69b

Browse files
committed
add json return test
1 parent aaed1ad commit 66fe69b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

astroquery/alma/tests/test_alma_remote.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,26 @@ def test_stage_data_listall(self, temp_dir, recwarn):
132132
assert 'PIPELINE_PRODUCT' in result2['type']
133133
assert 'PIPELINE_AUXILIARY_TARFILE' in result1['type']
134134

135+
def test_stage_data_json(self, temp_dir, recwarn):
136+
"""
137+
test for json returns
138+
"""
139+
alma = Alma()
140+
alma.cache_location = temp_dir
141+
142+
result_s = alma.query_object('Sgr A*')
143+
uid = 'uid://A001/X12a3/Xe9'
144+
assert uid in result_s['Member ous id']
145+
146+
result1 = alma.stage_data(uid, return_json=False)
147+
result2 = alma.stage_data(uid, return_json=True)
148+
149+
assert len(result1) > 0
150+
assert set(result2[0].keys()) == {'id', 'name', 'type', 'sizeInBytes',
151+
'permission', 'children',
152+
'allMousUids'}
153+
154+
135155
def test_doc_example(self, temp_dir):
136156
alma = Alma()
137157
alma.cache_location = temp_dir

0 commit comments

Comments
 (0)