Save pages returned by Save Page Now
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This is especially useful as pages freshly archived by SPN are not immediately shown as available by the Wayback Machine API, so we may send a pointless SPN request right after
This commit is contained in:
parent
8139bf5410
commit
1db60954d6
|
@ -157,4 +157,6 @@ class Session:
|
|||
|
||||
# If the Internet Archive does not have it yet, trigger its Save Code Now,
|
||||
# and query the Wayback Machine again
|
||||
return self._save_page_now(url)
|
||||
snapshot = self._save_page_now(url)
|
||||
self._db.add_web_page_snapshots([snapshot])
|
||||
return snapshot
|
||||
|
|
|
@ -148,6 +148,8 @@ def test_get__uncached__recent_wb(configured_requests_mocker, opdb_db: Db):
|
|||
content=b"Example page content from Wayback Machine",
|
||||
)
|
||||
|
||||
assert snapshot == opdb_db.get_last_web_page_snapshot("http://example.org/")
|
||||
|
||||
assert [(r.method, r.url) for r in configured_requests_mocker.request_history] == [
|
||||
(
|
||||
"GET",
|
||||
|
@ -214,6 +216,8 @@ def test_get__uncached__expired_wb(configured_requests_mocker, opdb_db: Db):
|
|||
content=b"Example page content from Wayback Machine after Save Page Now",
|
||||
)
|
||||
|
||||
assert snapshot == opdb_db.get_last_web_page_snapshot("http://example.org/")
|
||||
|
||||
assert [(r.method, r.url) for r in configured_requests_mocker.request_history] == [
|
||||
(
|
||||
"GET",
|
||||
|
|
Loading…
Reference in New Issue