Skip to content

TST: updating tests for vizier changes #665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions docs/registry/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -254,24 +254,23 @@ constraint on the description ``get_service(service_type='conesearch', keyword='

>>> for interface in voresource.list_interfaces():
... print(interface)
Interface(type='tap#aux', description='', url='http://tapvizier.cds.unistra.fr/TAPVizieR/tap')
Interface(type='vr:webbrowser', description='', url='http://vizier.cds.unistra.fr/viz-bin/VizieR-2?-source=J/ApJ/727/14')
Interface(type='tap#aux', description='', url='https://tapvizier.cds.unistra.fr/TAPVizieR/tap')
Interface(type='conesearch', description='Cone search capability for table J/ApJ/727/14/table2 (AKARI IRC 3-24{mu}m, and Spitzer MIPS 24/70{mu}m photometry of Abell 2255 member galaxies)', url='https://vizier.cds.unistra.fr/viz-bin/conesearch/J/ApJ/727/14/table2?')

Or construct the service object directly from the list of interfaces with:

.. doctest-remote-data::

>>> voresource.list_interfaces()[0].to_service()
TAPService(baseurl : 'http://tapvizier.cds.unistra.fr/TAPVizieR/tap', description : '')
TAPService(baseurl : 'https://tapvizier.cds.unistra.fr/TAPVizieR/tap', description : '')

The list of interfaces can also be filtered to interfaces corresponding to services of a
specific service type:

.. doctest-remote-data::

>>> voresource.list_interfaces("tap")
[Interface(type='tap#aux', description='', url='http://tapvizier.cds.unistra.fr/TAPVizieR/tap')]
[Interface(type='tap#aux', description='', url='https://tapvizier.cds.unistra.fr/TAPVizieR/tap')]

To operate TAP services, you need to know what tables make up a
resource; you could construct a TAP service and access its ``tables``
Expand Down
4 changes: 3 additions & 1 deletion pyvo/registry/tests/test_regtap.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ class _NS:

We need this here to let us conveniently construct _FakeResults.
"""

def __init__(self, **kwargs):
for k, v in kwargs.items():
setattr(self, k, v)
Expand All @@ -326,6 +327,7 @@ class _FakeResults:
It is constructed with a dictionary that should eventually be
used as the mapping in the Record.
"""

def __init__(self, valdict):
self.fieldnames = list(valdict.keys())
self.resultstable = _NS(array=_NS(data=[list(valdict.values())]))
Expand Down Expand Up @@ -727,7 +729,7 @@ def test_get_alt_identifier():
rsc = _makeRegistryRecord(ivoid="ivo://cds.vizier/i/337")
assert set(rsc.get_alt_identifiers()) == {
'doi:10.26093/cds/vizier.1337',
'bibcode:2016yCat.1337....0G'}
}


@pytest.mark.remote_data
Expand Down
Loading