Reader contract: READS declaration, Ask, Row with places and teaser, conformance test

plugins/readers/_contract.py holds Reads, Filters, Fields, Key, Ask, Place and
Row, and problems(), which checks a module's READS against its functions and
signatures. The package loader runs it for modules that declare READS and
lists the others with undeclared(); READERS holds every module, HOSTS the
boards and the undeclared, PROVIDERS the searches. The package docstring
documents the traits, Ask, facets, places, teaser and the robots.txt rule.

tests/test_readers_contract.py runs over every reader: READS declared (xfail
per module in UNDECLARED), declaration against functions, places="many"
and teaser fixtures, plus unit tests of the check with fake modules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-30 08:55:47 +02:00
1 parent 73dec9028e
commit 9f526356c0
7 files changed
+849 -55

No files matched your search

+3 -2
View File
@@ -33,10 +33,11 @@ FIXTURES = ROOT / "tests" / "fixtures" / "ats"
def test_the_registry_finds_every_module() -> None:
names = sorted(p.stem for p in (ROOT / "plugins" / "readers").glob("*.py")
if not p.stem.startswith("_"))
assert sorted(readers.HOSTS) == names
assert sorted(readers.READERS) == names
assert set(readers.HOSTS) | set(readers.PROVIDERS) == set(names)
assert set(names) >= {"greenhouse", "lever", "ashby", "workable", "smartrecruiters",
"recruitee", "personio", "teamtailor"}
assert all(not readers.problems(module, name) for name, module in readers.HOSTS.items())
assert all(not readers.problems(module, name) for name, module in readers.READERS.items())
# The Sources page's select and the plugin's description follow the modules.
assert {name: module.LABEL for name, module in readers.HOSTS.items()} == ats.HOSTS
assert "Teamtailor" in ats.ATSSource.description