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
@@ -17,7 +17,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, deel # noqa: E402
|
||||
from plugins.readers import Ask, _runner, deel # noqa: E402
|
||||
|
||||
PAGE = (ROOT / "tests" / "fixtures" / "ats" / "deel.html").read_bytes()
|
||||
URL = "https://jobs.deel.com/klarna"
|
||||
@@ -89,10 +89,12 @@ def test_a_board_without_roles_is_an_empty_board_but_another_page_is_not_a_board
|
||||
deel.parse(b"<html><title>Job Board Not Found</title></html>", "nobody")
|
||||
|
||||
|
||||
def test_a_posting_without_a_title_or_id_is_skipped() -> None:
|
||||
def test_a_posting_without_a_title_or_id_is_handed_over_for_the_runner_to_drop() -> None:
|
||||
body = {"jobPostings": [{"id": "a", "title": " ", "job": {}}, {"title": "x", "job": {}},
|
||||
{"id": "c", "title": "Cook", "job": {}}]}
|
||||
assert [r["source_id"] for r in deel.parse(_page_with(body), "acme")] == ["c"]
|
||||
rows = deel.parse(_page_with(body), "acme")
|
||||
assert [r["source_id"] for r in rows] == ["a", "", "c"]
|
||||
assert [r["source_id"] for r in rows if _runner.valid(r)] == ["c"]
|
||||
|
||||
|
||||
# ------------------------------------------------------------ the fetch
|
||||
|
||||
Reference in new issue
Block a user