Skip to content

Commit 74a94cf

Browse files
committed
Test resolving DOI
This helps distinguish temporary(?) errors in the DOI resolution from errors in the content provider
1 parent efb4cd3 commit 74a94cf

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/unit/contentproviders/test_doi.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,14 @@ def test_url_headers(requests_mock):
3030
assert result.request.headers["User-Agent"] == f"repo2docker {__version__}"
3131

3232

33-
def test_unresolving_doi():
33+
@pytest.mark.parametrize(
34+
"requested_doi, expected",
35+
[
36+
("10.5281/zenodo.3242074", "https://zenodo.org/records/3242074"),
37+
# Unresolving DOI:
38+
("10.1/1234", "10.1/1234"),
39+
],
40+
)
41+
def test_doi2url(requested_doi, expected):
3442
doi = DoiProvider()
35-
36-
fakedoi = "10.1/1234"
37-
assert doi.doi2url(fakedoi) is fakedoi
43+
assert doi.doi2url(requested_doi) == expected

0 commit comments

Comments
 (0)