Skip to content

Commit

Permalink
Merge pull request #395 from astropy/fix-epntap-discovery
Browse files Browse the repository at this point in the history
Fixing a query generation for the epn-tap data model.
  • Loading branch information
bsipocz committed Mar 7, 2023
1 parent 644ffb3 commit cc94b19
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
5 changes: 4 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
- registry.regsearch now accepts an optional maxrec argument rather than
automatically passing the service's hard limit. [#375]

- fixed the RegTAP fragment for the discovery of EPN-TAP tables. [#395]


1.4 (2022-09-26)
================

- Added the TAP Table Manipulation prototype (cadc-tb-upload). [#274]

- More explicit exception messages where the payload is
- More explicit exception messages where the payload is
sometimes considered if it can be presented properly (simple
body text or job error message). [#355]

Expand Down
2 changes: 1 addition & 1 deletion pyvo/registry/rtcons.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def _make_epntap_constraint(self):
# we include legacy, pre-IVOA utypes for matches; lowercase
# any new identifiers (utypes case-fold).
return " OR ".join(
f"table_utype LIKE {pat}'" for pat in
f"table_utype LIKE '{pat}'" for pat in
['ivo://vopdc.obspm/std/epncore#schema-2.%',
'ivo://ivoa.net/std/epntap#table-2.%'])

Expand Down
21 changes: 19 additions & 2 deletions pyvo/registry/tests/test_regtap.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,23 @@ def test_get_contact():
" <[email protected]>")


@pytest.mark.remote_data
class TestDatamodelQueries:
# right now, the data model queries are all rather sui generis, and
# rather fickly on top. Let's make sure they actually return something
# against the live registry. Admittedly, this is about as much
# a test of the VO infrastructure as of pyvo.

def test_obscore(self):
assert len(regsearch(rtcons.Datamodel('obscore'))) > 0

def test_epntap(self):
assert len(regsearch(rtcons.Datamodel('epntap'))) > 0

def test_regtap(self):
assert len(regsearch(rtcons.Datamodel('regtap'))) > 0


@pytest.mark.usefixtures('multi_interface_fixture', 'capabilities',
'flash_service')
class TestExtraResourceMethods:
Expand Down Expand Up @@ -690,8 +707,8 @@ def test_ambiguous_access_url_warns(self, recwarn):
"intf_roles": ["std"] * 2,
})
assert rsc.access_url == "http://a"
assert [str(w.message)[:50] for w in recwarn
] == ['The resource ivo://pyvo/test_regtap.py has multipl']
assert ('The resource ivo://pyvo/test_regtap.py has multipl' in
[str(w.message)[:50] for w in recwarn])


# TODO: While I suppose the contact test should keep requiring network,
Expand Down
4 changes: 2 additions & 2 deletions pyvo/registry/tests/test_rtcons.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ def test_obscore(self):
def test_epntap(self):
cons = rtcons.Datamodel("epntap")
assert (cons.get_search_condition()
== "table_utype LIKE ivo://vopdc.obspm/std/epncore#schema-2.%'"
" OR table_utype LIKE ivo://ivoa.net/std/epntap#table-2.%'")
== "table_utype LIKE 'ivo://vopdc.obspm/std/epncore#schema-2.%'"
" OR table_utype LIKE 'ivo://ivoa.net/std/epntap#table-2.%'")
assert (cons._extra_tables == ["rr.res_table"])

def test_regtap(self):
Expand Down

0 comments on commit cc94b19

Please sign in to comment.