Skip to content

Commit 932fb79

Browse files
committed
Use Path(a, b) instead of a / b
1 parent d64e314 commit 932fb79

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

astroquery/esasky/tests/test_esasky_remote.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_esasky_get_images_obs_id(self, tmp_path, mission, obsid):
7878
result = ESASky.get_images(observation_ids=obsid,
7979
missions=mission, download_dir=tmp_path)
8080

81-
assert (tmp_path / mission).exists()
81+
assert Path(tmp_path, mission).exists()
8282
if mission == "Herschel":
8383
assert isinstance(result[mission.upper()][0]["250"], HDUList)
8484
assert isinstance(result[mission.upper()][0]["350"], HDUList)
@@ -165,7 +165,7 @@ def test_esasky_get_spectra(self, tmp_path, mission):
165165
# - JWST_Near-IR returns a zip file with many fits files in it, unsupported
166166
ESASky.get_spectra(position="M1", missions=mission, download_dir=tmp_path)
167167

168-
assert (tmp_path / mission).exists()
168+
assert Path(tmp_path, mission).exists()
169169

170170
def test_esasky_get_spectra_small(self, tmp_path):
171171
missions = ['HST-IR']
@@ -174,21 +174,22 @@ def test_esasky_get_spectra_small(self, tmp_path):
174174
download_dir=tmp_path)
175175

176176
for mission in missions:
177-
assert (tmp_path / mission).exists()
177+
assert Path(tmp_path, mission).exists()
178178

179179
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)
181182

182183
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)
184185
# 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])
186187
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
188189

189-
iso_spectra2 = dict({'ISO-IR': all_spectra['ISO-IR'][:2]})
190+
iso_spectra2 = dict({mission: all_spectra[mission][:2]})
190191
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])
192193

193194
def test_query(self):
194195
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):
265266
assert "XMM" in fits_files
266267
assert isinstance(fits_files["XMM"][0], HDUList)
267268

268-
assert (tmp_path / "XMM").exists()
269+
assert Path(tmp_path, "XMM").exists()

0 commit comments

Comments
 (0)