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
@@ -20,7 +20,7 @@ if str(ROOT) not in sys.path:
|
||||
|
||||
from app.jobs import discover # noqa: E402
|
||||
from plugins import ats # noqa: E402
|
||||
from plugins.readers import workday # noqa: E402
|
||||
from plugins.readers import _runner, workday # noqa: E402
|
||||
|
||||
FIXTURES = ROOT / "tests" / "fixtures" / "ats"
|
||||
SLUG = "zendesk.wd1/zendesk"
|
||||
@@ -96,7 +96,7 @@ def test_posted_is_read_only_where_the_text_is_exact(text: str, expected: dateti
|
||||
assert workday._posted(text) == expected
|
||||
|
||||
|
||||
def test_a_posting_without_a_title_or_a_path_is_skipped() -> None:
|
||||
def test_a_posting_without_a_title_or_a_path_reaches_the_runner_and_is_dropped() -> None:
|
||||
page = {"jobPostings": [
|
||||
{"bulletFields": ["0000036369"]}, # LEGO's, no title
|
||||
{"title": "No path", "bulletFields": ["R1"]},
|
||||
@@ -105,7 +105,16 @@ def test_a_posting_without_a_title_or_a_path_is_skipped() -> None:
|
||||
{"title": "Whole", "externalPath": "/job/X/Whole_R4", "locationsText": "X",
|
||||
"postedOn": "Posted Today", "bulletFields": ["R4"]},
|
||||
]}
|
||||
assert [r["title"] for r in workday.rows(page, SLUG)] == ["Whole"]
|
||||
rows = workday.rows(page, SLUG)
|
||||
assert len(rows) == 5
|
||||
assert [(r["source_id"], r["url"]) for r in rows[:2]] == [("", ""), ("", "")]
|
||||
assert [r["title"] for r in rows if _runner.valid(r)] == ["Whole"]
|
||||
# Through the runner: four dropped and counted, and the read complete,
|
||||
# since every posting counts by its position towards the stated total.
|
||||
body = json.dumps(page | {"total": 5}).encode()
|
||||
listing = _runner.read_listing(workday, SLUG, lambda url, **kw: body)
|
||||
assert [r["title"] for r in listing.rows] == ["Whole"]
|
||||
assert (listing.handed, listing.dropped, listing.complete) == (5, 4, True)
|
||||
|
||||
|
||||
def test_the_id_is_the_path_where_the_requisition_id_is_not_in_it() -> None:
|
||||
|
||||
Reference in new issue
Block a user