Fix figshare unit test

pull/1390/head
YuviPanda 2024-12-17 12:52:47 -08:00
rodzic f4d58dcd2f
commit d71efb892d
1 zmienionych plików z 2 dodań i 9 usunięć

Wyświetl plik

@ -21,16 +21,9 @@ test_content_ids = [
@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