Skip to content

Commit

Permalink
Add emails for all ContactPersons in test data
Browse files Browse the repository at this point in the history
  • Loading branch information
mvandenburgh committed Jun 24, 2024
1 parent 9a12bff commit b90238f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dandischema/tests/data/metadata/meta_000008.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
{
"schemaKey": "Person",
"name": "Scala, Federico",
"email": "[email protected]",
"roleName": [
"dcite:DataCollector",
"dcite:Author",
Expand Down Expand Up @@ -150,6 +151,7 @@
"schemaKey": "Person",
"identifier": "0000-0002-4305-6376",
"name": "Tolias, Andreas Savas",
"email": "[email protected]",
"roleName": [
"dcite:Author",
"dcite:ContactPerson"
Expand Down
13 changes: 13 additions & 0 deletions dandischema/tests/test_datacite.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ def test_datacite(dandi_id: str, schema: Any) -> None:
{
"name": "A_last, A_first",
"roleName": [RoleType("dcite:ContactPerson")],
"email": "[email protected]",
"schemaKey": "Person",
},
{
Expand Down Expand Up @@ -224,6 +225,7 @@ def test_datacite(dandi_id: str, schema: Any) -> None:
{
"name": "A_last, A_first",
"roleName": [RoleType("dcite:ContactPerson")],
"email": "[email protected]",
"schemaKey": "Person",
},
{
Expand All @@ -245,6 +247,7 @@ def test_datacite(dandi_id: str, schema: Any) -> None:
{
"name": "A_last, A_first",
"roleName": [RoleType("dcite:ContactPerson")],
"email": "[email protected]",
"schemaKey": "Person",
},
{
Expand Down Expand Up @@ -274,6 +277,7 @@ def test_datacite(dandi_id: str, schema: Any) -> None:
{
"name": "A_last, A_first",
"roleName": [RoleType("dcite:ContactPerson")],
"email": "[email protected]",
"schemaKey": "Person",
},
{
Expand Down Expand Up @@ -314,6 +318,7 @@ def test_datacite(dandi_id: str, schema: Any) -> None:
{
"name": "B_last, B_first",
"roleName": [RoleType("dcite:ContactPerson")],
"email": "[email protected]",
"schemaKey": "Person",
},
],
Expand Down Expand Up @@ -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)
Expand All @@ -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():
Expand All @@ -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):
Expand Down

0 comments on commit b90238f

Please sign in to comment.