-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backing out of requesting alt_identifiers every time.
This is supposed to address bug #522. The code as it was up to here would have needed aggregation of alt_identifiers (which are n:1 over resources), or else we see duplicate capabilities. But at least some registry operators prefer to not hit the rr.alt_identifier table by default as long as it's not clear who will actually look at these alternate identifiers. But we maintain the alt identifiers in describe(); to do that, there's now get_alternate_identifiers method returning these. The downside: describe() now does an uncached network query. Perhaps we want to at least hide failures from there? On the other hand, once we are here we can also call get_contact() here; should we?
- Loading branch information
Showing
4 changed files
with
41 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -720,6 +720,15 @@ def test_get_contact(): | |
" <[email protected]>") | ||
|
||
|
||
@pytest.mark.remote_data | ||
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:doi:10.5270/esa-ogmeula', | ||
'bibcode:2016yCat.1337....0G'} | ||
|
||
|
||
@pytest.mark.remote_data | ||
class TestDatamodelQueries: | ||
# right now, the data model queries are all rather sui generis, and | ||
|
@@ -754,6 +763,7 @@ def test_unique_standard_id(self): | |
intf_roles=["std"]) | ||
assert rsc.standard_id == "ivo://ivoa.net/std/tap" | ||
|
||
@pytest.mark.remote_data | ||
def test_describe_multi(self, flash_service): | ||
out = io.StringIO() | ||
flash_service.describe(verbose=True, file=out) | ||
|
@@ -765,9 +775,10 @@ def test_describe_multi(self, flash_service): | |
assert "Multi-capability service" in output | ||
assert "Source: 1996A&A...312..539S" in output | ||
assert "Authors: Wolf" in output | ||
assert "Alternative identifier: doi:10.21938/" in output | ||
assert "Alternative identifier(s): doi:10.21938/" in output | ||
assert "More info: http://dc.zah" in output | ||
|
||
@pytest.mark.remote_data | ||
def test_describe_long_authors_list(self): | ||
"""Check that long list of authors use et al..""" | ||
rsc = _makeRegistryRecord( | ||
|
@@ -785,6 +796,7 @@ def test_describe_long_authors_list(self): | |
# output should cut at 5 authors | ||
assert "Authors: a, a, a, a, a et al." in output | ||
|
||
@pytest.mark.remote_data | ||
def test_describe_long_author_name(self): | ||
"""Check that long author names are truncated.""" | ||
rsc = _makeRegistryRecord( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters