From 96e38edde79735b4080ec08d57e9f54759e97b61 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Thu, 2 Jan 2020 17:35:54 +0100 Subject: datacite: add conversion fixtures The `test_datacite_conversions` function will compare an input (datacite) document to an expected output (release entity as JSON). This way, it should not be too hard to add more cases by adding: input, output - and by increasing the counter in the range loop within the test. To view input and result side by side with vim, change into the test directory and run: tests/files/datacite $ ./caseview.sh 18 --- python/tests/files/datacite/datacite_doc_13.json | 86 ++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 python/tests/files/datacite/datacite_doc_13.json (limited to 'python/tests/files/datacite/datacite_doc_13.json') diff --git a/python/tests/files/datacite/datacite_doc_13.json b/python/tests/files/datacite/datacite_doc_13.json new file mode 100644 index 00000000..ff6eb229 --- /dev/null +++ b/python/tests/files/datacite/datacite_doc_13.json @@ -0,0 +1,86 @@ +{ + "id": "10.5169/seals-314104", + "type": "dois", + "attributes": { + "doi": "10.5169/seals-314104", + "identifiers": [ + { + "identifier": "https://doi.org/10.5169/seals-314104", + "identifierType": "DOI" + } + ], + "creators": [ + { + "name": "O.M.", + "affiliation": [] + }, + { + "name": "Hiltbrunner, Hermann", + "nameType": "Personal", + "givenName": "Hermann", + "familyName": "Hiltbrunner", + "affiliation": [] + } + ], + "titles": [ + { + "title": "[Müssen wir des Glücks uns schämen?]" + } + ], + "publisher": "Buchdruckerei Büchler & Co.", + "container": {}, + "publicationYear": 1940, + "subjects": [], + "contributors": [], + "dates": [ + { + "date": "1940-10-05", + "dateType": "Available" + }, + { + "date": "1940", + "dateType": "Issued" + } + ], + "language": null, + "types": { + "ris": "JOUR", + "bibtex": "article", + "citeproc": "article-journal", + "schemaOrg": "ScholarlyArticle", + "resourceType": "Journal Article", + "resourceTypeGeneral": "Text" + }, + "relatedIdentifiers": [], + "sizes": [], + "formats": [ + "text/html", + "application/pdf" + ], + "version": null, + "rightsList": [], + "descriptions": [], + "geoLocations": [], + "fundingReferences": [], + "url": "https://www.e-periodica.ch/digbib/view?pid=sle-001:1940-1941:45::13", + "contentUrl": null, + "metadataVersion": 17, + "schemaVersion": "http://datacite.org/schema/kernel-3", + "source": null, + "isActive": true, + "state": "findable", + "reason": null, + "created": "2013-03-22T14:02:08.000Z", + "registered": "2013-03-22T13:58:11.000Z", + "published": "1940", + "updated": "2019-08-02T02:22:55.000Z" + }, + "relationships": { + "client": { + "data": { + "id": "ethz.seals", + "type": "clients" + } + } + } +} -- cgit v1.2.3