diff --git a/dandischema/tests/data/metadata/meta_000008.json b/dandischema/tests/data/metadata/meta_000008.json index cff98888..704dd14d 100644 --- a/dandischema/tests/data/metadata/meta_000008.json +++ b/dandischema/tests/data/metadata/meta_000008.json @@ -8,6 +8,7 @@ { "schemaKey": "Person", "name": "Scala, Federico", + "email": "fscala@example.com", "roleName": [ "dcite:DataCollector", "dcite:Author", @@ -150,6 +151,7 @@ "schemaKey": "Person", "identifier": "0000-0002-4305-6376", "name": "Tolias, Andreas Savas", + "email": "atolias@example.com", "roleName": [ "dcite:Author", "dcite:ContactPerson" diff --git a/dandischema/tests/test_datacite.py b/dandischema/tests/test_datacite.py index 9e918294..40b541a3 100644 --- a/dandischema/tests/test_datacite.py +++ b/dandischema/tests/test_datacite.py @@ -196,6 +196,7 @@ def test_datacite(dandi_id: str, schema: Any) -> None: { "name": "A_last, A_first", "roleName": [RoleType("dcite:ContactPerson")], + "email": "nemo@example.com", "schemaKey": "Person", }, { @@ -224,6 +225,7 @@ def test_datacite(dandi_id: str, schema: Any) -> None: { "name": "A_last, A_first", "roleName": [RoleType("dcite:ContactPerson")], + "email": "nemo@example.com", "schemaKey": "Person", }, { @@ -245,6 +247,7 @@ def test_datacite(dandi_id: str, schema: Any) -> None: { "name": "A_last, A_first", "roleName": [RoleType("dcite:ContactPerson")], + "email": "nemo@example.com", "schemaKey": "Person", }, { @@ -274,6 +277,7 @@ def test_datacite(dandi_id: str, schema: Any) -> None: { "name": "A_last, A_first", "roleName": [RoleType("dcite:ContactPerson")], + "email": "nemo@example.com", "schemaKey": "Person", }, { @@ -314,6 +318,7 @@ def test_datacite(dandi_id: str, schema: Any) -> None: { "name": "B_last, B_first", "roleName": [RoleType("dcite:ContactPerson")], + "email": "nemo@example.com", "schemaKey": "Person", }, ], @@ -391,6 +396,7 @@ def test_dandimeta_datacite( dandi_id = metadata_basic["identifier"] dandi_id_noprefix = dandi_id.split(":")[1] + from pprint import pprint metadata_basic.update(_basic_publishmeta(dandi_id=dandi_id_noprefix)) metadata_basic.update(additional_meta) @@ -401,6 +407,9 @@ def test_dandimeta_datacite( validator = Draft7Validator(schema) validator.validate(datacite["data"]["attributes"]) + pprint(datacite_checks) + pprint(datacite) + # checking some datacite fields attr = datacite["data"]["attributes"] for key, el in datacite_checks.items(): @@ -409,6 +418,10 @@ def test_dandimeta_datacite( # checking length and some fields from the first element assert len(attr[key]) == el_len for k, v in el_flds.items(): + print(k, v) + pprint(attr[key][0]) + # pprint(el_flds) + # print() assert attr[key][0][k] == v else: if isinstance(el_flds, dict):