aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2020-01-02 19:02:04 +0100
committerMartin Czygan <martin.czygan@gmail.com>2020-01-02 19:02:04 +0100
commit61f0bbfbfdaf41be799fa41c88077806ef913188 (patch)
treeb1b839d5cb94e63c720baac08cc0dee1ae0f015a
parent9d4385210518266d73964f140f47995774656c3f (diff)
downloadfatcat-61f0bbfbfdaf41be799fa41c88077806ef913188.tar.gz
fatcat-61f0bbfbfdaf41be799fa41c88077806ef913188.zip
datacite: add another test case
-rw-r--r--python/tests/files/datacite/datacite_doc_24.json48
-rw-r--r--python/tests/files/datacite/datacite_result_24.json22
-rw-r--r--python/tests/import_datacite.py2
3 files changed, 71 insertions, 1 deletions
diff --git a/python/tests/files/datacite/datacite_doc_24.json b/python/tests/files/datacite/datacite_doc_24.json
new file mode 100644
index 00000000..6123350b
--- /dev/null
+++ b/python/tests/files/datacite/datacite_doc_24.json
@@ -0,0 +1,48 @@
+{
+ "attributes": {
+ "doi": "10.7916/d86x0cg1",
+ "creators": [
+ {
+ "name": "Anton Welch",
+ "affiliation": [
+ "Department of pataphysics"
+ ],
+ "nameIdentifiers": []
+ }
+ ],
+ "titles": [
+ {
+ "title": "ABC"
+ },
+ {
+ "title": "DEF",
+ "titleType": "Subtitle"
+ }
+ ],
+ "publicationYear": 2016,
+ "language": "DE-CH",
+ "types": {
+ "ris": "GEN",
+ "bibtex": "misc",
+ "citeproc": "article",
+ "schemaOrg": "CreativeWork"
+ },
+ "dates": [
+ {
+ "date": "2017-08-24",
+ "dateType": "Created"
+ },
+ {
+ "date": "2019-08-04",
+ "dateType": "Updated"
+ },
+ {
+ "date": "2017",
+ "dateType": "Issued"
+ }
+ ],
+ "isActive": true,
+ "state": "findable"
+ }
+ }
+
diff --git a/python/tests/files/datacite/datacite_result_24.json b/python/tests/files/datacite/datacite_result_24.json
new file mode 100644
index 00000000..42859275
--- /dev/null
+++ b/python/tests/files/datacite/datacite_result_24.json
@@ -0,0 +1,22 @@
+{
+ "extra": {},
+ "title": "ABC",
+ "subtitle": "DEF",
+ "release_type": "article",
+ "release_stage": "published",
+ "release_date": "2017-08-24",
+ "release_year": 2017,
+ "ext_ids": {
+ "doi": "10.7916/d86x0cg1"
+ },
+ "contribs": [
+ {
+ "index": 0,
+ "raw_name": "Anton Welch",
+ "role": "author",
+ "raw_affiliation": "Department of pataphysics"
+ }
+ ],
+ "refs": [],
+ "abstracts": []
+}
diff --git a/python/tests/import_datacite.py b/python/tests/import_datacite.py
index 3e47fce8..54a529c5 100644
--- a/python/tests/import_datacite.py
+++ b/python/tests/import_datacite.py
@@ -282,7 +282,7 @@ def test_datacite_conversions(datacite_importer):
for now.
"""
datacite_importer.debug = True
- for i in range(24):
+ for i in range(25):
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))