From 4e452afae432ac718482b62d276bee42adc1e660 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 19 May 2021 15:50:06 -0700 Subject: web: fixes to access redirect endpoints --- fatcat_scholar/hacks.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'fatcat_scholar/hacks.py') diff --git a/fatcat_scholar/hacks.py b/fatcat_scholar/hacks.py index 1b53e01..0f16fc7 100644 --- a/fatcat_scholar/hacks.py +++ b/fatcat_scholar/hacks.py @@ -118,6 +118,12 @@ def test_wayback_direct_url() -> None: ) == "https://web.archive.org/web/1234id_/http://fatcat.wiki/thing.pdf" ) + assert ( + wayback_direct_url( + "https://web.archive.org/web/20170811115414/http://sudjms.net/issues/5-4/pdf/8)A%20comparison%20study%20of%20histochemical%20staining%20of%20various%20tissues%20after.pdf" + ) + == "https://web.archive.org/web/20170811115414id_/http://sudjms.net/issues/5-4/pdf/8)A%20comparison%20study%20of%20histochemical%20staining%20of%20various%20tissues%20after.pdf" + ) def make_access_redirect_url(access_type: str, access_url: str) -> str: @@ -157,3 +163,10 @@ def test_make_access_redirect_url() -> None: make_access_redirect_url("blah", "https://mit.edu/file.pdf") == "https://mit.edu/file.pdf" ) + assert ( + make_access_redirect_url( + "wayback", + "https://web.archive.org/web/20170811115414/http://sudjms.net/issues/5-4/pdf/8)A%20comparison%20study%20of%20histochemical%20staining%20of%20various%20tissues%20after.pdf", + ) + == "https://scholar.archive.org/access/wayback/20170811115414/http://sudjms.net/issues/5-4/pdf/8)A%20comparison%20study%20of%20histochemical%20staining%20of%20various%20tissues%20after.pdf" + ) -- cgit v1.2.3