Skip to content

Commit

Permalink
Fix figshare unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvipanda committed Dec 17, 2024
1 parent f4d58dc commit d71efb8
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions tests/unit/contentproviders/test_figshare.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,9 @@


@pytest.mark.parametrize("link,expected", test_content_ids)
def test_content_id(link, expected, requests_mock):
def mocked_get(req, context):
if req.url.startswith("https://doi.org"):
context.status_code = 302
context.headers["Location"] = link
return link

requests_mock.get(re.compile("https://"), text=mocked_get)
def test_content_id(link, expected):
fig = Figshare()
fig.detect("10.6084/m9.figshare.9782777")
fig.detect(link)
assert fig.content_id == expected


Expand Down

0 comments on commit d71efb8

Please sign in to comment.