summaryrefslogtreecommitdiffstats
path: root/python/tests/import_datacite.py
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2020-01-08 22:33:58 +0100
committerMartin Czygan <martin.czygan@gmail.com>2020-01-08 22:33:58 +0100
commit62d6a7e48d6bea1bc7f451c6043f38aee2051f9b (patch)
treec28079d6f3a12f106607fb6fc1fa9a4a5c83d9de /python/tests/import_datacite.py
parentb7a325360ca8ae3107411e9e1966d93b999bbb52 (diff)
downloadfatcat-62d6a7e48d6bea1bc7f451c6043f38aee2051f9b.tar.gz
fatcat-62d6a7e48d6bea1bc7f451c6043f38aee2051f9b.zip
datacite: factor out contributor handling
Use values from: * attributes.creators[] * attributes.contributors[]
Diffstat (limited to 'python/tests/import_datacite.py')
-rw-r--r--python/tests/import_datacite.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/tests/import_datacite.py b/python/tests/import_datacite.py
index 7293ecac..5ad7ef2c 100644
--- a/python/tests/import_datacite.py
+++ b/python/tests/import_datacite.py
@@ -275,7 +275,7 @@ def test_datacite_dict_parse(datacite_importer):
assert r.extra['datacite']['subjects'] == [{'subject': 'Plant Genetic Resource for Food and Agriculture'}]
assert len(r.abstracts) == 1
assert len(r.abstracts[0].content) == 421
- assert len(r.contribs) == 1
+ assert len(r.contribs) == 2
assert r.contribs[0].raw_name == "GLIS Of The ITPGRFA"
assert r.contribs[0].given_name == None
assert r.contribs[0].surname == None
@@ -287,7 +287,7 @@ def test_datacite_conversions(datacite_importer):
for now.
"""
datacite_importer.debug = True
- for i in range(26):
+ for i in range(27):
src = 'tests/files/datacite/datacite_doc_{0:02d}.json'.format(i)
dst = 'tests/files/datacite/datacite_result_{0:02d}.json'.format(i)
print('testing mapping from {} => {}'.format(src, dst))