Gemini test cleanup
@@ -19,8 +19,8 @@ DATA_FILES = {"m101": "m101.json"}
class MockResponse(object):
- def __init__(self, content):
- self.content = content
+ def __init__(self, text):
+ self.text = text
@pytest.fixture
@@ -35,8 +35,11 @@ def patch_get(request):
def get_mockreturn(url, *args, **kwargs):
filename = data_path(DATA_FILES['m101'])
- content = open(filename, 'r').read()
- return MockResponse(content)
+ f = open(filename, 'r')
+ text = f.read()
+ retval = MockResponse(text)
+ f.close()
+ return retval
def data_path(filename):
@@ -47,11 +50,16 @@ def data_path(filename):
coords = SkyCoord(210.80242917, 54.34875, unit="deg")
-def test_observations_query_region_async(patch_get):
- responses = gemini.Observations.query_region_async(coords, radius=0.3)
- assert isinstance(responses, list)
-
-
def test_observations_query_region(patch_get):
result = gemini.Observations.query_region(coords, radius=0.3 * units.deg)
assert isinstance(result, Table)
+
+
+def test_observations_query_criteria(patch_get):
+ result = gemini.Observations.query_criteria(instrument='GMOS-N', program_id='GN-CAL20191122', observation_type='BIAS')
+ assert isinstance(result, Table)
+
+
+def test_observations_query_raw(patch_get):
+ result = gemini.Observations.query_raw('GMOS-N', 'BIAS', progid='GN-CAL20191122')
+ assert isinstance(result, Table)
