@@ -75,13 +75,6 @@ def test_SgrAstar(self, temp_dir, alma):
75
75
# "The Brick", g0.253, is in this one
76
76
# assert b'2011.0.00217.S' in result_c['Project code'] # missing cycle 1 data
77
77
78
- def test_docs_example (self , temp_dir , alma ):
79
- alma .cache_location = temp_dir
80
-
81
- rslt = alma .query (payload = dict (obs_creator_name = '*Ginsburg*' ))
82
-
83
- assert 'ADS/JAO.ALMA#2013.1.00269.S' in rslt ['obs_publisher_did' ]
84
-
85
78
def test_freq (self , alma ):
86
79
payload = {'frequency' : '85..86' }
87
80
result = alma .query (payload )
@@ -141,22 +134,6 @@ def test_m83(self, temp_dir, alma):
141
134
# Except it has. On May 18, 2016, there were 47.
142
135
assert len (link_list ) >= 47
143
136
144
- # test re-staging
145
- # (has been replaced with warning)
146
- # with pytest.raises(requests.HTTPError) as ex:
147
- # link_list = alma.stage_data(uids)
148
- # assert ex.value.args[0] == ('Received an error 405: this may indicate you have '
149
- # 'already staged the data. Try downloading the '
150
- # 'file URLs directly with download_files.')
151
-
152
- # log.warning doesn't actually make a warning
153
- # link_list = alma.stage_data(uids)
154
- # w = recwarn.pop()
155
- # assert (str(w.message) == ('Error 405 received. If you have previously staged the '
156
- # 'same UIDs, the result returned is probably correct,'
157
- # ' otherwise you may need to create a fresh astroquery.Alma instance.'))
158
-
159
-
160
137
def test_data_proprietary (self , alma ):
161
138
# public
162
139
assert not alma .is_proprietary ('uid://A001/X12a3/Xe9' )
@@ -198,16 +175,15 @@ def test_data_info(self, temp_dir, alma):
198
175
file_url = url
199
176
break
200
177
assert file_url
201
- alma .download_files ([file_url ], temp_dir )
178
+ alma .download_files ([file_url ], savedir = temp_dir )
202
179
assert os .stat (os .path .join (temp_dir , file )).st_size
203
180
204
181
# mock downloading an entire program
205
182
download_files_mock = Mock ()
206
183
alma .download_files = download_files_mock
207
184
alma .retrieve_data_from_uid ([uid ])
208
185
209
- comparison = download_files_mock .mock_calls [0 ][1 ] == data_info_tar [
210
- 'access_url' ]
186
+ comparison = download_files_mock .mock_calls [0 ][1 ] == data_info_tar ['access_url' ]
211
187
assert comparison .all ()
212
188
213
189
def test_download_data (self , temp_dir , alma ):
@@ -224,7 +200,7 @@ def test_download_data(self, temp_dir, alma):
224
200
alma ._download_file = download_mock
225
201
urls = [x ['access_url' ] for x in data_info
226
202
if fitsre .match (x ['access_url' ])]
227
- results = alma .download_files (urls , temp_dir )
203
+ results = alma .download_files (urls , savedir = temp_dir )
228
204
alma ._download_file .call_count == len (results )
229
205
assert len (results ) == len (urls )
230
206
0 commit comments