Skip to content

Commit

Permalink
Update call counts in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvipanda committed Dec 14, 2024
1 parent 7f980f4 commit 4f287dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/unit/contentproviders/test_hydroshare.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def test_detect_hydroshare(requests_mock):
assert (
Hydroshare().detect("10.4211/hs.b8f6eae9d89241cf8b5904033460af61") == expected
)
# assert 3 calls were made, 2 to resolve the DOI (302 + 200) and another to fetch the version
assert requests_mock.call_count == 3
# assert 2 calls were made, 1 to resolve the DOI (302) and another to fetch the version
assert requests_mock.call_count == 2
requests_mock.reset_mock()

assert (
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/contentproviders/test_zenodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def test_detect_zenodo(test_input, expected, requests_mock):
assert Zenodo().detect(test_input[0]) == expected
assert Zenodo().detect(test_input[1]) == expected
assert Zenodo().detect(test_input[2]) == expected
# only two of the three calls above have to resolve a DOI (2 req per doi resolution)
assert requests_mock.call_count == 4
# only two of the three calls above have to resolve a DOI (1 req per doi resolution)
assert requests_mock.call_count == 2
requests_mock.reset_mock()

# Don't trigger the Zenodo content provider
Expand Down

0 comments on commit 4f287dd

Please sign in to comment.