Count a page of ids already read as a stall only where the host states no total or the reader hands the page over empty, so a resumed sweep reads on when the list grew at the top
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
7f37270eb3
commit
c4c17fb019
3 files changed
+39
-23
No files matched your search
+1
-7
@@ -618,13 +618,7 @@ def test_the_page_cap_leaves_a_board_incomplete(
|
||||
|
||||
def fake_get(client, url, host, slug, *, method="GET", payload=None):
|
||||
calls.append(payload)
|
||||
# Always another page of roles not read yet: a page of nothing new
|
||||
# would be a stall, which ends the read before the cap.
|
||||
page = json.loads(_page("workable.json"))
|
||||
page["total"] = 100
|
||||
for result in page["results"]:
|
||||
result["id"] = f"{result['id']}-{len(calls)}"
|
||||
return json.dumps(page).encode()
|
||||
return _page("workable.json") # always another page
|
||||
|
||||
monkeypatch.setattr(ats, "MAX_PAGES", 3)
|
||||
monkeypatch.setattr(ats, "_get", fake_get)
|
||||
|
||||
Reference in new issue
Block a user