31
31
32
32
33
33
@pytest .fixture (name = 'capabilities' )
34
- def _capabilities (mocker ):
34
+ def _capabilities (mocker , scope = "session" ):
35
35
def callback (request , context ):
36
36
return get_pkg_data_contents ('data/capabilities.xml' )
37
37
@@ -52,15 +52,15 @@ def callback(request, context):
52
52
53
53
54
54
@pytest .fixture (name = 'regtap_pulsar_distance_response' )
55
- def _regtap_pulsar_distance_response (mocker ):
55
+ def _regtap_pulsar_distance_response (mocker , scope = "session" ):
56
56
with mocker .register_uri (
57
57
'POST' , REGISTRY_BASEURL + '/sync' ,
58
58
content = get_pkg_data_contents ('data/regtap.xml' )) as matcher :
59
59
yield matcher
60
60
61
61
62
62
@pytest .fixture ()
63
- def keywords_fixture (mocker ):
63
+ def keywords_fixture (mocker , scope = "session" ):
64
64
def keywordstest_callback (request , context ):
65
65
data = dict (parse_qsl (request .body ))
66
66
query = data ['QUERY' ]
@@ -83,7 +83,7 @@ def keywordstest_callback(request, context):
83
83
84
84
85
85
@pytest .fixture ()
86
- def single_keyword_fixture (mocker ):
86
+ def single_keyword_fixture (mocker , scope = "session" ):
87
87
def keywordstest_callback (request , context ):
88
88
data = dict (parse_qsl (request .body ))
89
89
query = data ['QUERY' ]
@@ -102,7 +102,7 @@ def keywordstest_callback(request, context):
102
102
103
103
104
104
@pytest .fixture ()
105
- def servicetype_fixture (mocker ):
105
+ def servicetype_fixture (mocker , scope = "session" ):
106
106
def servicetypetest_callback (request , context ):
107
107
data = dict (parse_qsl (request .body ))
108
108
query = data ['QUERY' ]
@@ -123,7 +123,7 @@ def servicetypetest_callback(request, context):
123
123
124
124
125
125
@pytest .fixture ()
126
- def waveband_fixture (mocker ):
126
+ def waveband_fixture (mocker , scope = "session" ):
127
127
def wavebandtest_callback (request , content ):
128
128
data = dict (parse_qsl (request .body ))
129
129
query = data ['QUERY' ]
@@ -140,7 +140,7 @@ def wavebandtest_callback(request, content):
140
140
141
141
142
142
@pytest .fixture ()
143
- def datamodel_fixture (mocker ):
143
+ def datamodel_fixture (mocker , scope = "session" ):
144
144
def datamodeltest_callback (request , content ):
145
145
data = dict (parse_qsl (request .body ))
146
146
query = data ['QUERY' ]
@@ -162,7 +162,7 @@ def datamodeltest_callback(request, content):
162
162
163
163
164
164
@pytest .fixture ()
165
- def aux_fixture (mocker ):
165
+ def aux_fixture (mocker , scope = "session" ):
166
166
def auxtest_callback (request , context ):
167
167
data = dict (parse_qsl (request .body ))
168
168
query = data ['QUERY' ]
@@ -179,7 +179,7 @@ def auxtest_callback(request, context):
179
179
180
180
181
181
@pytest .fixture (name = 'multi_interface_fixture' )
182
- def _multi_interface_fixture (mocker ):
182
+ def _multi_interface_fixture (mocker , scope = "session" ):
183
183
# to update this, run
184
184
# import requests
185
185
# from pyvo.registry import regtap
@@ -197,7 +197,7 @@ def _multi_interface_fixture(mocker):
197
197
198
198
199
199
@pytest .fixture (name = 'flash_service' )
200
- def _flash_service (multi_interface_fixture ):
200
+ def _flash_service (multi_interface_fixture , scope = "session" ):
201
201
return regtap .search (
202
202
ivoid = "ivo://org.gavo.dc/flashheros/q/ssa" )[0 ]
203
203
@@ -849,14 +849,14 @@ def test_ambiguous_access_url_warns(self, recwarn):
849
849
# TODO: While I suppose the contact test should keep requiring network,
850
850
# I think we should can the network responses involved in the following;
851
851
# the stuff might change upstream any time and then break our unit tests.
852
- @pytest .fixture (name = 'flash_tables ' )
853
- def _flash_tables ( ):
852
+ @pytest .fixture (name = 'obscore_tables ' )
853
+ def _obscore_tables ( scope = "session" ):
854
854
rsc = _makeRegistryRecord (
855
- ivoid = "ivo://org.gavo.dc/flashheros/q/ssa " )
855
+ ivoid = "ivo://org.gavo.dc/__system__/obscore/obscore " )
856
856
return rsc .get_tables ()
857
857
858
858
859
- @pytest .mark .usefixtures ("flash_tables " )
859
+ @pytest .mark .usefixtures ("obscore_tables " )
860
860
class TestGetTables :
861
861
@pytest .mark .remote_data
862
862
def test_get_tables_limit_enforced (self ):
@@ -869,47 +869,49 @@ def test_get_tables_limit_enforced(self):
869
869
" Pass a higher table_limit to see them all." , str (excinfo .value ))
870
870
871
871
@pytest .mark .remote_data
872
- def test_get_tables_names (self , flash_tables ):
873
- assert (list (sorted (flash_tables .keys ()))
874
- == ["flashheros.data" , " ivoa.obscore" ])
872
+ def test_get_tables_names (self , obscore_tables ):
873
+ assert (list (sorted (obscore_tables .keys ()))
874
+ == ["ivoa.obscore" ])
875
875
876
876
@pytest .mark .remote_data
877
- def test_get_tables_table_instance (self , flash_tables ):
878
- assert (flash_tables ["ivoa.obscore" ].name
877
+ def test_get_tables_table_instance (self , obscore_tables ):
878
+ assert (obscore_tables ["ivoa.obscore" ].name
879
879
== "ivoa.obscore" )
880
- assert (flash_tables ["ivoa.obscore" ].description
881
- == "This data collection is queryable in GAVO Data"
882
- " Center's obscore table." )
883
- assert (flash_tables ["flashheros.data" ].title
884
- == "Flash/Heros SSA table" )
880
+ assert (obscore_tables ["ivoa.obscore" ].description [:42 ]
881
+ == "The IVOA-defined obscore table, containing" )
882
+ assert (obscore_tables ["ivoa.obscore" ].title
883
+ == "GAVO Data Center Obscore Table" )
885
884
886
- assert (flash_tables [ "flashheros.data " ].origin .ivoid
887
- == "ivo://org.gavo.dc/flashheros/q/ssa " )
885
+ assert (obscore_tables [ "ivoa.obscore " ].origin .ivoid
886
+ == "ivo://org.gavo.dc/__system__/obscore/obscore " )
888
887
889
888
@pytest .mark .remote_data
890
- def test_get_tables_column_meta (self , flash_tables ):
891
- def getflashcol (name ):
892
- for col in flash_tables [ "flashheros.data " ].columns :
889
+ def test_get_tables_column_meta (self , obscore_tables ):
890
+ def getcol (name ):
891
+ for col in obscore_tables [ "ivoa.obscore " ].columns :
893
892
if name == col .name :
894
893
return col
895
894
raise KeyError (name )
896
895
897
- assert getflashcol ("accref" ).datatype .content == "char"
898
- assert getflashcol ("accref" ).datatype .arraysize == "*"
896
+ assert getcol ("access_url" ).datatype .content == "char"
897
+ assert getcol ("access_url" ).datatype .arraysize == "*"
898
+
899
+ assert getcol ("s_region" ).datatype ._extendedtype == "adql:region"
899
900
900
- # TODO: upstream bug: the following needs to fixed in DaCHS before
901
- # the assertion passes
902
- # assert getflashcol("ssa_region").datatype._extendedtype == "point"
901
+ assert getcol ("access_format" ).ucd == 'meta.code.mime'
903
902
904
- assert getflashcol ( "mime " ).ucd == 'meta.code.mime'
903
+ assert getcol ( "em_min " ).unit == "m"
905
904
906
- assert getflashcol ("ssa_specend" ).unit == "m"
905
+ assert (getcol ("t_max" ).utype
906
+ == "obscore:char.timeaxis.coverage.bounds.limits.stoptime" )
907
907
908
- assert (getflashcol ( "ssa_specend " ).utype
909
- == "ssa:char.spectralaxis.coverage.bounds.stop " )
908
+ assert (getcol ( "t_exptime " ).description
909
+ == "Total exposure time " )
910
910
911
- assert (getflashcol ("ssa_fluxcalib" ).description
912
- == "Type of flux calibration" )
911
+ @pytest .mark .remote_data
912
+ def test_get_tables_utype (self , obscore_tables ):
913
+ assert (obscore_tables ["ivoa.obscore" ].utype
914
+ == "ivo://ivoa.net/std/obscore#table-1.1" )
913
915
914
916
915
917
@pytest .mark .remote_data
0 commit comments