diff options
author | Bryan Newbold <bnewbold@archive.org> | 2020-05-16 13:57:21 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2020-05-16 13:57:21 -0700 |
commit | f5cb3637ccc0914a027a452a214c845deb36494b (patch) | |
tree | eb9ef4953f7779ab6eaf239a1810c3898500266a /tests | |
parent | 1a081b80e1406144a6a7aa650884a4e64afc466c (diff) | |
download | fatcat-scholar-f5cb3637ccc0914a027a452a214c845deb36494b.tar.gz fatcat-scholar-f5cb3637ccc0914a027a452a214c845deb36494b.zip |
basic biblio converter
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_transform.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/test_transform.py b/tests/test_transform.py index b7bdb4d..cb1ad5c 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -13,7 +13,16 @@ def test_es_release_from_release(): obj = es_release_from_release(release) d = json.loads(obj.json()) - assert obj.ident == release.ident == "hsmo6p4smrganpb3fndaj2lon4" assert obj.ident == release.ident == d['ident'] == "hsmo6p4smrganpb3fndaj2lon4" assert obj.doi_registrar == "crossref" assert obj.doi_prefix == "10.7717" + +def test_es_biblio_from_release(): + + with open('tests/files/release_hsmo6p4smrganpb3fndaj2lon4.json', 'r') as f: + release = entity_from_json(f.read(), ReleaseEntity) + + obj = es_biblio_from_release(release) + d = json.loads(obj.json()) + + assert obj.release_ident == release.ident == d['release_ident'] == "hsmo6p4smrganpb3fndaj2lon4" |