@@ -40,15 +40,14 @@ def remove_last_job():
40
40
41
41
@pytest .mark .remote_data
42
42
class TestEsaHubbleRemoteData :
43
-
44
43
obs_query = "select top 2050 o.observation_id from ehst.observation o"
45
44
46
45
top_obs_query = "select top 100 o.observation_id from ehst.observation o"
47
46
48
- hst_query = "select top 50 o.observation_id from ehst.observation " \
47
+ hst_query = "select top 50 o.observation_id from ehst.observation " \
49
48
"o where o.collection='HST'"
50
49
51
- top_artifact_query = "select top 50 a.artifact_id, a.observation_id " \
50
+ top_artifact_query = "select top 50 a.artifact_id, a.observation_id " \
52
51
" from ehst.artifact a"
53
52
54
53
temp_folder = create_temp_folder ()
@@ -75,12 +74,6 @@ def test_get_artifact(self):
75
74
esa_hubble .get_artifact (artifact_id , temp_file )
76
75
assert os .path .exists (temp_file )
77
76
78
- def test_query_target (self ):
79
- temp_file = self .temp_folder .name + "/" + "m31_query.xml"
80
- table = esa_hubble .query_target ("m31" , temp_file )
81
- assert os .path .exists (temp_file )
82
- assert 'OBSERVATION_ID' in table .columns
83
-
84
77
def test_cone_search (self ):
85
78
esa_hubble = ESAHubble ()
86
79
c = coordinates .SkyCoord ("00h42m44.51s +41d16m08.45s" , frame = 'icrs' )
@@ -90,3 +83,42 @@ def test_cone_search(self):
90
83
assert 'observation_id' in table .columns
91
84
assert len (table ) > 0
92
85
remove_last_job ()
86
+
87
+ # tests for get_related_members
88
+ def test_hst_composite_to_hst_simple (self ):
89
+ esa_hubble = ESAHubble ()
90
+ result = esa_hubble .get_member_observations ('jdrz0c010' )
91
+ assert result == ['jdrz0cjxq' , 'jdrz0cjyq' ]
92
+
93
+ def test_hst_simple_to_hst_composite (self ):
94
+ esa_hubble = ESAHubble ()
95
+ result = esa_hubble .get_member_observations ('jdrz0cjxq' )
96
+ assert result == ['jdrz0c010' ]
97
+
98
+ def test_hap_composite_to_hap_simple (self ):
99
+ esa_hubble = ESAHubble ()
100
+ result = esa_hubble .get_member_observations ('hst_15446_4v_acs_wfc_f606w_jdrz4v' )
101
+ assert result == ['hst_15446_4v_acs_wfc_f606w_jdrz4vkv' , 'hst_15446_4v_acs_wfc_f606w_jdrz4vkw' ]
102
+
103
+ def test_hap_simple_to_hap_composite (self ):
104
+ esa_hubble = ESAHubble ()
105
+ result = esa_hubble .get_member_observations ('hst_16316_71_acs_sbc_f150lp_jec071i9' )
106
+ assert result == ['hst_16316_71_acs_sbc_f150lp_jec071' ]
107
+
108
+ def test_hap_simple_to_hst_simple (self ):
109
+ esa_hubble = ESAHubble ()
110
+ result = esa_hubble .get_hap_hst_link ('hst_16316_71_acs_sbc_f150lp_jec071i9' )
111
+ assert result == ['jec071i9q' ]
112
+
113
+ def test_hst_simple_to_hap_simple (self ):
114
+ esa_hubble = ESAHubble ()
115
+ result = esa_hubble .get_hap_hst_link ('jec071i9q' )
116
+ assert result == ['hst_16316_71_acs_sbc_f150lp_jec071i9' ]
117
+
118
+ """
119
+ def test_query_target(self):
120
+ temp_file = self.temp_folder.name + "/" + "m31_query.xml"
121
+ table = esa_hubble.query_target("m31", temp_file)
122
+ assert os.path.exists(temp_file)
123
+ assert 'OBSERVATION_ID' in table.columns
124
+ """
0 commit comments