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_10.json | 83 ++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 python/tests/files/datacite/datacite_doc_10.json (limited to 'python/tests/files/datacite/datacite_doc_10.json') diff --git a/python/tests/files/datacite/datacite_doc_10.json b/python/tests/files/datacite/datacite_doc_10.json new file mode 100644 index 00000000..d40fc272 --- /dev/null +++ b/python/tests/files/datacite/datacite_doc_10.json @@ -0,0 +1,83 @@ +{ + "id": "10.25549/wpacards-m6171", + "type": "dois", + "attributes": { + "doi": "10.25549/wpacards-m6171", + "identifiers": [ + { + "identifier": "https://doi.org/10.25549/wpacards-m6171", + "identifierType": "DOI" + } + ], + "creators": [ + { + "name": "Unknown", + "affiliation": [] + } + ], + "titles": [ + { + "title": "WPA household census for 210 E VERNON, Los Angeles" + } + ], + "publisher": "University of Southern California Digital Library (USC.DL)", + "container": {}, + "publicationYear": 2012, + "subjects": [ + { + "subject": "housing areas" + }, + { + "subject": "Dwellings" + } + ], + "contributors": [], + "dates": [ + { + "date": "2012", + "dateType": "Issued" + } + ], + "language": "eng", + "types": { + "ris": "DATA", + "bibtex": "misc", + "citeproc": "dataset", + "schemaOrg": "Dataset", + "resourceType": "Dataset", + "resourceTypeGeneral": "Dataset" + }, + "relatedIdentifiers": [], + "sizes": [], + "formats": [], + "version": null, + "rightsList": [], + "descriptions": [ + { + "descriptionType": "Abstract" + } + ], + "geoLocations": [], + "fundingReferences": [], + "url": "http://digitallibrary.usc.edu/cdm/ref/collection/p15799coll8/id/2608", + "contentUrl": null, + "metadataVersion": 0, + "schemaVersion": "http://datacite.org/schema/kernel-4", + "source": "mds", + "isActive": true, + "state": "findable", + "reason": null, + "created": "2018-09-09T08:32:09.000Z", + "registered": "2018-09-09T08:33:10.000Z", + "published": "2012", + "updated": "2019-08-02T20:03:32.000Z" + }, + "relationships": { + "client": { + "data": { + "id": "usc.dl", + "type": "clients" + } + } + } +} -- cgit v1.2.3