From a221625eff96eb62e5174d25107ec7582b592ace Mon Sep 17 00:00:00 2001 From: Wolf Date: Wed, 30 Sep 2026 16:01:30 +0200 Subject: [PATCH] Give the test readers a READS, a dated robots record and the search params the contract now requires Co-Authored-By: Claude Fable 5.1 --- tests/test_readers.py | 5 ++++- tests/test_search.py | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_readers.py b/tests/test_readers.py index 49251f6..8a0b89c 100644 --- a/tests/test_readers.py +++ b/tests/test_readers.py @@ -64,8 +64,11 @@ PATTERNS = (r"good\\.example/([a-z]+)",) def slug_ok(slug): return True def allowed(slug): return lambda h: h == "good.example" def careers_url(slug): return "https://good.example/" + slug -def feed_url(slug): return "https://good.example/" + slug + ".json" +def feed_url(slug, ask): return "https://good.example/" + slug + ".json" def parse(body, slug): return [] +from plugins.readers import Reads +READS = Reads(scope="board", listing="whole", text="listing", complete="whole", places="one", + robots="read (checked 2026-09-30)") """ diff --git a/tests/test_search.py b/tests/test_search.py index 0cf9d9e..d9c13c0 100644 --- a/tests/test_search.py +++ b/tests/test_search.py @@ -264,8 +264,10 @@ def _fake_provider(monkeypatch: pytest.MonkeyPatch, ids: list[str], complete: bo module: Any = types.ModuleType("fake") module.NAME, module.LABEL = "fake", "Fake" module.READS = Reads(scope="search", listing="paged", text="listing", complete="stated", - places="one", fields=Fields(country="stated"), robots="test") + places="one", fields=Fields(country="stated"), robots="test (checked 2026-09-30)") module.allowed = lambda slug: lambda host: host == "search.fake.example" + module.PARAMS = {"q": "query"} + module.clean_params = lambda params: dict(params) def page(get: Any, slug: str, cursor: Any, ask: Ask) -> Any: assert ask.params["q"]