-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BF: move reused _basic_publishmeta into dandischema/datacite/__init__…
….py + fix typing issue
- Loading branch information
1 parent
115bee0
commit a9c909f
Showing
4 changed files
with
36 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,40 @@ | ||
from datetime import datetime | ||
import os | ||
from typing import Any, Dict | ||
|
||
import pytest | ||
|
||
skipif_no_network = pytest.mark.skipif( | ||
bool(os.environ.get("DANDI_TESTS_NONETWORK")), reason="no network settings" | ||
) | ||
|
||
|
||
def _basic_publishmeta( | ||
dandi_id: str, version: str = "0.0.0", prefix: str = "10.80507" | ||
) -> Dict[str, Any]: | ||
"""Return extra metadata required by PublishedDandiset | ||
Returned fields are additional to fields required by Dandiset | ||
""" | ||
publish_meta = { | ||
"datePublished": str(datetime.now().year), | ||
"publishedBy": { | ||
"id": "urn:uuid:08fffc59-9f1b-44d6-8e02-6729d266d1b6", | ||
"name": "DANDI publish", | ||
"startDate": "2021-05-18T19:58:39.310338-04:00", | ||
"endDate": "2021-05-18T19:58:39.310361-04:00", | ||
"wasAssociatedWith": [ | ||
{ | ||
"id": "urn:uuid:9267d2e1-4a37-463b-9b10-dad3c66d8eaa", | ||
"identifier": "RRID:SCR_017571", | ||
"name": "DANDI API", | ||
"version": "0.1.0", | ||
"schemaKey": "Software", | ||
} | ||
], | ||
"schemaKey": "PublishActivity", | ||
}, | ||
"version": version, | ||
"doi": f"{prefix}/dandi.{dandi_id}/{version}", | ||
} | ||
return publish_meta |