Skip to content

Commit ae0daec

Browse files
committed
Improve test coverage
1 parent b93e5a7 commit ae0daec

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

astroquery/casda/tests/test_casda.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,27 @@ def test_cutout_no_args(patch_get):
321321
assert "Please provide cutout parameters such as coordinates, band or channel." in str(excinfo.value)
322322

323323

324+
def test_cutout_unauthorised(patch_get):
325+
prefix = 'https://somewhere/casda/datalink/links?'
326+
access_urls = [prefix + 'cube-244']
327+
table = Table([Column(data=access_urls, name='access_url')])
328+
ra = 333.9092*u.deg
329+
dec = -45.8418*u.deg
330+
radius = 30*u.arcmin
331+
centre = SkyCoord(ra, dec)
332+
333+
with pytest.raises(ValueError) as excinfo:
334+
Casda.cutout(table, coordinates=centre, radius=radius, verbose=True)
335+
assert "Credentials must be supplied to download CASDA image data" in str(excinfo.value)
336+
337+
338+
def test_cutout_no_table():
339+
casda = Casda('user', 'password')
340+
casda.POLL_INTERVAL = 1
341+
result = casda.cutout(None)
342+
assert result == []
343+
344+
324345
def test_args_to_payload_band():
325346
casda = Casda('user', 'password')
326347
payload = casda._args_to_payload(band=(0.195*u.m, 0.215*u.m))

0 commit comments

Comments
 (0)