diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2021-11-02 18:13:14 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2021-11-02 18:13:14 -0700 |
commit | cdfd6b85b386b7bbf9d5a5179ef26970b6e5a4e7 (patch) | |
tree | 5e4034027b51f3ee4d2a488bb2cbb7a75c3bd0d8 /python/tests/citation_efficiency.py | |
parent | 78f08280edea4ff65ca613ad30005c45cc48dea6 (diff) | |
download | fatcat-cdfd6b85b386b7bbf9d5a5179ef26970b6e5a4e7.tar.gz fatcat-cdfd6b85b386b7bbf9d5a5179ef26970b6e5a4e7.zip |
fmt (black): tests/
Diffstat (limited to 'python/tests/citation_efficiency.py')
-rw-r--r-- | python/tests/citation_efficiency.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/python/tests/citation_efficiency.py b/python/tests/citation_efficiency.py index 1d57dfeb..2aeb28ea 100644 --- a/python/tests/citation_efficiency.py +++ b/python/tests/citation_efficiency.py @@ -1,4 +1,3 @@ - from fatcat_openapi_client import * from fixtures import * @@ -34,6 +33,7 @@ def test_citation_indexing(api): assert r1.refs[1].index == 1 assert r1.refs[1].key == "third" + def test_citation_targets(api): # invariant to linking citations # also, updates work @@ -56,12 +56,13 @@ def test_citation_targets(api): r2 = api.get_release(r2.ident) assert r2.refs[0].key == "first" assert r2.refs[1].key == "second" - assert r2.refs[0].index == 0 # TODO: one-indexing? + assert r2.refs[0].index == 0 # TODO: one-indexing? assert r2.refs[1].index == 1 assert r2.refs[0].target_release_id is None assert r2.refs[1].target_release_id == r1.ident assert len(r2.refs) == 2 + def test_citation_empty_array(api): # distinction between empty array (no citations) and no array (hidden) @@ -83,17 +84,24 @@ def test_citation_empty_array(api): r1b = api.get_release(r1.ident, hide="refs") assert r1b.refs is None + def test_citation_encoding(api): # escape-only changes (eg, \u1234 whatever for ASCII) r1 = ReleaseEntity(title="citation encoding", ext_ids=ReleaseExtIds()) - title = "title-unicode \\u0050 \\\" " + title = 'title-unicode \\u0050 \\" ' container = "container-unicode ☃︎ ä ö ü スティー" - extra = extra={'a': 1, 'b': 2, 'ö': 3} + extra = extra = {"a": 1, "b": 2, "ö": 3} locator = "p123" r1.refs = [ - ReleaseRef(key="1", year=1923, title=title, container_name=container, - extra=extra, locator=locator), + ReleaseRef( + key="1", + year=1923, + title=title, + container_name=container, + extra=extra, + locator=locator, + ), ReleaseRef(key="2"), ] |