Skip to content

Commit

Permalink
Merge pull request #1385 from dandi/fix-tests
Browse files Browse the repository at this point in the history
Fix service script tests for change in autogenerated date
  • Loading branch information
yarikoptic authored Jan 3, 2024
2 parents 4d725d2 + f4d687d commit 2355c2c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion dandi/cli/tests/test_service_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,18 @@ def test_update_dandiset_from_doi(
expected["manifestLocation"][
0
] = f"{new_dandiset.api.api_url}/dandisets/{dandiset_id}/versions/draft/assets/"
expected["citation"] = re.sub(
citation = re.sub(
r"\S+\Z",
f"{repository}/dandiset/{dandiset_id}/draft",
expected["citation"],
)
if m := re.search(r"\(\d{4}\)", citation):
citation_rgx = (
re.escape(citation[: m.start()])
+ r"\(\d{4}\)"
+ re.escape(citation[m.end() :])
)
expected["citation"] = anys.AnyFullmatch(citation_rgx)
else:
expected["citation"] = citation
assert metadata == expected

0 comments on commit 2355c2c

Please sign in to comment.