Skip to content

Commit be76a9e

Browse files
committed
add remote tests (minimal)
1 parent 6e6ee56 commit be76a9e

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Licensed under a 3-clause BSD style license - see LICENSE.rst
2+
import os
3+
import tempfile
4+
import shutil
5+
from astropy.tests.helper import pytest, remote_data
6+
from .. import Alma
7+
from ...exceptions import LoginError
8+
9+
10+
@remote_data
11+
class TestAlma:
12+
@pytest.fixture()
13+
def temp_dir(self, request):
14+
my_temp_dir = tempfile.mkdtemp()
15+
def fin():
16+
shutil.rmtree(my_temp_dir)
17+
request.addfinalizer(fin)
18+
return my_temp_dir
19+
20+
def test_SgrAstar(self, temp_dir):
21+
alma = Alma()
22+
alma.cache_location = temp_dir
23+
24+
result_s = alma.query_object('Sgr A*')
25+
assert '2011.0.00217.S' in result_s['Project_code']
26+
c = coordinates.SkyCoord(266.41681662, -29.00782497, frame='fk5')
27+
result_c = alma.query_region(c, 1*u.deg)
28+
assert '2011.0.00217.S' in result_c['Project_code']
29+
30+
def test_stage_data(self, temp_dir):
31+
alma = Alma()
32+
alma.cache_location = temp_dir
33+
34+
result_s = alma.query_object('Sgr A*')
35+
assert '2011.0.00217.S' in result_s['Project_code']
36+
37+
uid = result_s['Asdm_uid'][0]
38+
39+
alma.stage_data([uid])

0 commit comments

Comments
 (0)