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 <noreply@anthropic.com>
This commit is contained in:
1 parent
fe2a1b0347
commit
a221625eff
2 files changed
+7
-2
No files matched your search
@@ -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)")
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -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"]
|
||||
|
||||
Reference in new issue
Block a user