Skip to content

Commit 2c58487

Browse files
committed
test: add wait time after DOI creation
To avoid the behavior of the bug documented at datacite/datacite#2307 so that our test servers are not populated with undeletable DOIs.
1 parent cabfa3d commit 2c58487

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

dandischema/datacite/tests/test_datacite.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import json
33
import os
44
import random
5+
from time import sleep
56
from typing import TYPE_CHECKING, Any, Dict, Tuple, cast
67

78
from jsonschema import Draft7Validator
@@ -158,6 +159,10 @@ def datacite_post(datacite: dict, doi: str) -> None:
158159
)
159160
rp.raise_for_status()
160161

162+
# Wait for DataCite the correctly process the DOI creation
163+
# to avoid the bug documented in https://github.com/datacite/datacite/issues/2307
164+
sleep(3)
165+
161166
# checking if i'm able to get the url
162167
rg = requests.get(url=f"https://api.test.datacite.org/dois/{doi}/activities")
163168
rg.raise_for_status()

0 commit comments

Comments
 (0)