aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/sandcrawler/ia.py2
-rw-r--r--python/tests/test_wayback.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/python/sandcrawler/ia.py b/python/sandcrawler/ia.py
index 198c8aa..6544e58 100644
--- a/python/sandcrawler/ia.py
+++ b/python/sandcrawler/ia.py
@@ -257,7 +257,7 @@ class WaybackClient:
# whole cluster is down though.
status_code = gwb_record.get_status()[0]
- location = (gwb_record.get_location() or [None])[0]
+ location = gwb_record.get_location() or None
body = None
if status_code == 200:
diff --git a/python/tests/test_wayback.py b/python/tests/test_wayback.py
index 2aafe7c..efffbe2 100644
--- a/python/tests/test_wayback.py
+++ b/python/tests/test_wayback.py
@@ -118,8 +118,8 @@ def wayback_client(cdx_client, mocker):
client.rstore = mocker.Mock()
resource = mocker.Mock()
client.rstore.load_resource = mocker.MagicMock(return_value=resource)
- resource.get_status = mocker.MagicMock(return_value=[200])
- resource.get_location = mocker.MagicMock(return_value=[WARC_TARGET])
+ resource.get_status = mocker.MagicMock(return_value=(200, "Ok"))
+ resource.get_location = mocker.MagicMock(return_value=WARC_TARGET)
body = mocker.Mock()
resource.open_raw_content = mocker.MagicMock(return_value=body)
body.read = mocker.MagicMock(return_value=WARC_BODY)
@@ -140,8 +140,8 @@ def wayback_client_pdf(cdx_client, mocker):
client.rstore = mocker.Mock()
resource = mocker.Mock()
client.rstore.load_resource = mocker.MagicMock(return_value=resource)
- resource.get_status = mocker.MagicMock(return_value=[200])
- resource.get_location = mocker.MagicMock(return_value=[WARC_TARGET])
+ resource.get_status = mocker.MagicMock(return_value=(200, "Ok"))
+ resource.get_location = mocker.MagicMock(return_value=WARC_TARGET)
body = mocker.Mock()
resource.open_raw_content = mocker.MagicMock(return_value=body)
body.read = mocker.MagicMock(return_value=pdf_bytes)