@@ -78,7 +78,7 @@ def test_esasky_get_images_obs_id(self, tmp_path, mission, obsid):
78
78
result = ESASky .get_images (observation_ids = obsid ,
79
79
missions = mission , download_dir = tmp_path )
80
80
81
- assert (tmp_path / mission ).exists ()
81
+ assert Path (tmp_path , mission ).exists ()
82
82
if mission == "Herschel" :
83
83
assert isinstance (result [mission .upper ()][0 ]["250" ], HDUList )
84
84
assert isinstance (result [mission .upper ()][0 ]["350" ], HDUList )
@@ -165,7 +165,7 @@ def test_esasky_get_spectra(self, tmp_path, mission):
165
165
# - JWST_Near-IR returns a zip file with many fits files in it, unsupported
166
166
ESASky .get_spectra (position = "M1" , missions = mission , download_dir = tmp_path )
167
167
168
- assert (tmp_path / mission ).exists ()
168
+ assert Path (tmp_path , mission ).exists ()
169
169
170
170
def test_esasky_get_spectra_small (self , tmp_path ):
171
171
missions = ['HST-IR' ]
@@ -174,21 +174,22 @@ def test_esasky_get_spectra_small(self, tmp_path):
174
174
download_dir = tmp_path )
175
175
176
176
for mission in missions :
177
- assert (tmp_path / mission ).exists ()
177
+ assert Path (tmp_path , mission ).exists ()
178
178
179
179
def test_esasky_get_spectra_from_table (self , tmp_path ):
180
- file_path = tmp_path / 'ISO-IR'
180
+ mission = 'ISO-IR'
181
+ file_path = Path (tmp_path , mission )
181
182
182
183
all_spectra = ESASky .query_object_spectra (position = "M51" )
183
- iso_spectra = ESASky .query_object_spectra (position = "M51" , missions = 'ISO-IR' )
184
+ iso_spectra = ESASky .query_object_spectra (position = "M51" , missions = mission )
184
185
# Remove a few maps, so the other list will have downloadable ones, too
185
- iso_spectra ['ISO-IR' ].remove_rows ([0 , 1 ])
186
+ iso_spectra [mission ].remove_rows ([0 , 1 ])
186
187
ESASky .get_spectra_from_table (query_table_list = iso_spectra , download_dir = tmp_path )
187
- assert len (os .listdir (file_path )) == len (all_spectra ['ISO-IR' ]) - 2
188
+ assert len (os .listdir (file_path )) == len (all_spectra [mission ]) - 2
188
189
189
- iso_spectra2 = dict ({'ISO-IR' : all_spectra ['ISO-IR' ][:2 ]})
190
+ iso_spectra2 = dict ({mission : all_spectra [mission ][:2 ]})
190
191
ESASky .get_spectra_from_table (query_table_list = iso_spectra2 , download_dir = tmp_path )
191
- assert len (os .listdir (file_path )) == len (all_spectra ['ISO-IR' ])
192
+ assert len (os .listdir (file_path )) == len (all_spectra [mission ])
192
193
193
194
def test_query (self ):
194
195
result = ESASky .query (query = "SELECT * from observations.mv_v_esasky_xmm_om_uv_fdw" )
@@ -265,4 +266,4 @@ def test_esasky_get_images_sso(self, tmp_path):
265
266
assert "XMM" in fits_files
266
267
assert isinstance (fits_files ["XMM" ][0 ], HDUList )
267
268
268
- assert (tmp_path / "XMM" ).exists ()
269
+ assert Path (tmp_path , "XMM" ).exists ()
0 commit comments