@@ -86,20 +86,21 @@ def test_esasky_get_images_obs_id(self, tmp_path, mission, obsid):
86
86
else :
87
87
assert isinstance (result [mission .upper ()][0 ], HDUList )
88
88
89
- def test_esasky_get_spectra_obs_id (self , tmp_path ):
90
- missions = ["ISO-IR" , "Chandra" , "IUE" , "XMM-NEWTON" , "HST-IR" , "Herschel" , "HST-UV" , "HST-OPTICAL" ]
89
+ @pytest .mark .parametrize ("mission, observation_id" ,
90
+ zip (["ISO-IR" , "Chandra" , "IUE" , "XMM-NEWTON" ,
91
+ "HST-IR" , "Herschel" , "HST-UV" , "HST-OPTICAL" ],
92
+ ["02101201" , "1005" , "LWR13178" , "0001730201" ,
93
+ "ibh706cqq" , "1342253595" , "z1ax0102t" , "oeik2s020" ]))
94
+ def test_esasky_get_spectra_obs_id (self , tmp_path , mission , observation_id ):
95
+ result = ESASky .get_spectra (observation_ids = observation_id ,
96
+ missions = mission , download_dir = tmp_path )
91
97
92
- result = ESASky .get_spectra (observation_ids = ["02101201" , "1005" , "LWR13178" , "0001730201" , "ibh706cqq" ,
93
- "1342253595" , "z1ax0102t" , "oeik2s020" ],
94
- missions = missions , download_dir = tmp_path )
95
-
96
- for mission in missions :
97
- assert (tmp_path / mission ).exists ()
98
- if mission .upper () == "HERSCHEL" :
99
- assert (isinstance (result [mission .upper ()]["1342253595" ]["WBS" ]["WBS-V_USB_4b" ], HDUList ))
100
- assert (isinstance (result [mission .upper ()]["1342253595" ]["HRS" ]["HRS-H_LSB_4b" ], HDUList ))
101
- else :
102
- assert (isinstance (result [mission .upper ()][0 ], HDUList ))
98
+ assert Path (tmp_path , mission ).exists ()
99
+ if mission == "Herschel" :
100
+ assert isinstance (result [mission .upper ()]["1342253595" ]["WBS" ]["WBS-V_USB_4b" ], HDUList )
101
+ assert isinstance (result [mission .upper ()]["1342253595" ]["HRS" ]["HRS-H_LSB_4b" ], HDUList )
102
+ else :
103
+ assert isinstance (result [mission .upper ()][0 ], HDUList )
103
104
104
105
def test_esasky_query_region_maps (self ):
105
106
result = ESASky .query_region_maps (position = "M51" , radius = "5 arcmin" )
@@ -111,7 +112,7 @@ def test_esasky_query_object_maps(self):
111
112
112
113
@pytest .mark .bigdata
113
114
@pytest .mark .parametrize ("mission" , ['XMM' , 'Chandra' , 'XMM-OM-OPTICAL' ,
114
- 'ISO-IR' ,'Herschel' , 'JWST_Mid-IR' ,
115
+ 'ISO-IR' , 'Herschel' , 'JWST_Mid-IR' ,
115
116
'JWST_Near-IR' , 'Spitzer' ])
116
117
def test_esasky_get_images (self , tmp_path , mission ):
117
118
ESASky .get_images (position = "M51" , missions = mission , download_dir = tmp_path )
0 commit comments