Skip to content

Commit

Permalink
Fix service script tests for change in autogenerated date
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed Jan 2, 2024
1 parent 4d725d2 commit f4d687d
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

Check warning on line 132 in dandi/cli/tests/test_service_scripts.py

View check run for this annotation

Codecov / codecov/patch

dandi/cli/tests/test_service_scripts.py#L132

Added line #L132 was not covered by tests
assert metadata == expected

0 comments on commit f4d687d

Please sign in to comment.