From d71efb892db240759d5a09749c9b0e2808c370f0 Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Tue, 17 Dec 2024 12:52:47 -0800 Subject: [PATCH] Fix figshare unit test --- tests/unit/contentproviders/test_figshare.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/tests/unit/contentproviders/test_figshare.py b/tests/unit/contentproviders/test_figshare.py index b4f42de31..760c0e487 100644 --- a/tests/unit/contentproviders/test_figshare.py +++ b/tests/unit/contentproviders/test_figshare.py @@ -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