Let the runner drop and count a row without an id, a title or a link, as ADR Plugins 3.8 has it, in one place for whole, paged and search reads: the count is stamped per target, logged, named on the board's row, and over 10% of the rows fails the read; the 28 readers hand every listing over instead of skipping it
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
38c31c830b
commit
911dfe8584
58 files changed
+479
-203
No files matched your search
@@ -16,7 +16,7 @@ if str(ROOT) not in sys.path:
|
||||
|
||||
from app.jobs.discover import boards_in # noqa: E402
|
||||
from plugins import ats, readers # noqa: E402
|
||||
from plugins.readers import Ask, jobylon # noqa: E402
|
||||
from plugins.readers import Ask, _runner, jobylon # noqa: E402
|
||||
|
||||
FIXTURES = ROOT / "tests" / "fixtures" / "ats"
|
||||
BOARD = (FIXTURES / "jobylon.html").read_bytes()
|
||||
@@ -65,12 +65,14 @@ def test_the_literal_reader_takes_quotes_escapes_and_trailing_commas() -> None:
|
||||
assert [r["title"] for r in jobylon.parse(body, "9")] == ["A ] B"]
|
||||
|
||||
|
||||
def test_a_role_whose_link_is_not_a_role_page_is_skipped() -> None:
|
||||
def test_a_role_whose_link_is_not_a_role_page_gets_no_link_and_is_dropped() -> None:
|
||||
body = (b"JBL.embed_v2['jobs'] = [{id: '1', title: 'A', url: 'https://evil.example/jobs/1/'},"
|
||||
b"{id: '2', title: 'B', url: '//evil.example/jobs/2/'},"
|
||||
b"{id: '3', title: 'C', url: '/companies/3/'},"
|
||||
b"{id: '4', title: 'D', url: '/jobs/4-d/'}];\n")
|
||||
assert [r["source_id"] for r in jobylon.parse(body, "9")] == ["4"]
|
||||
rows = jobylon.parse(body, "9")
|
||||
assert [r["url"] for r in rows[:3]] == ["", "", ""]
|
||||
assert [r["source_id"] for r in rows if _runner.valid(r)] == ["4"]
|
||||
|
||||
|
||||
# ---------------------------------------------------------------- detail
|
||||
|
||||
Reference in new issue
Block a user