Skip to content

Commit a727507

Browse files
committed
add datamodel regsearch test
1 parent 5c2c1e7 commit a727507

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

pyvo/registry/tests/test_regtap.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,26 @@ def wavebandtest_callback(request, content):
9898
yield matcher
9999

100100

101+
@pytest.fixture()
102+
def datamodel_fixture(mocker):
103+
def datamodeltest_callback(request, content):
104+
data = dict(parse_qsl(request.body))
105+
query = data['QUERY']
106+
107+
assert (
108+
"WHERE idet.detail_xpath = '/capability/dataModel/@ivo-id" in query
109+
)
110+
assert "idet.detail_value, 'ivo://ivoa.net/std/tap%')" in query
111+
112+
return get_pkg_data_contents('data/regtap.xml')
113+
114+
with mocker.register_uri(
115+
'POST', 'http://dc.g-vo.org/tap/sync',
116+
content=datamodeltest_callback
117+
) as matcher:
118+
yield matcher
119+
120+
101121
@pytest.mark.usefixtures('keywords_fixture', 'capabilities')
102122
def test_keywords():
103123
regsearch(keywords=['vizier', 'pulsar'])
@@ -111,3 +131,8 @@ def test_servicetype():
111131
@pytest.mark.usefixtures('waveband_fixture', 'capabilities')
112132
def test_waveband():
113133
regsearch(waveband='optical')
134+
135+
136+
@pytest.mark.usefixtures('datamodel_fixture', 'capabilities')
137+
def test_datamodel():
138+
regsearch(datamodel='tap')

0 commit comments

Comments
 (0)