diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2020-01-30 13:36:01 +0100 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2020-01-30 13:36:01 +0100 |
commit | 7dec2d1560ebf5ca6d0d337eb246fe345f6ec0bb (patch) | |
tree | 7acfda698ff56ce2e9690a4026fbc212fd411895 /python/tests/import_datacite.py | |
parent | 55a4f211532c93d8164b0d4719dc0413005941ea (diff) | |
download | fatcat-7dec2d1560ebf5ca6d0d337eb246fe345f6ec0bb.tar.gz fatcat-7dec2d1560ebf5ca6d0d337eb246fe345f6ec0bb.zip |
datacite: improve date handling and minor tweak
Records from https://www.micropublication.org/ did not have a date in
FC, although raw data contained date strings - they were not using the
finer-grained "attributes.date" but "attributes.published" and/or
"attributes.publicationYear".
Support for those fields has been added, including a test case.
During this test (#30) a processing gap for names became clear (author
may have "given_name" and "surname", but no "name"). This bug has been
fixed, too.
Diffstat (limited to 'python/tests/import_datacite.py')
-rw-r--r-- | python/tests/import_datacite.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/python/tests/import_datacite.py b/python/tests/import_datacite.py index 669a6984..15650375 100644 --- a/python/tests/import_datacite.py +++ b/python/tests/import_datacite.py @@ -287,10 +287,9 @@ def test_datacite_conversions(datacite_importer): for now. """ datacite_importer.debug = True - for i in range(30): + for i in range(31): 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)) with open(src, 'r') as f: re = datacite_importer.parse_record(json.load(f)) result = entity_to_dict(re) |