Embed a role again when its text arrives, and keep the place its own page gave
A role listed before its page was read kept a title-only vector, and the listing's place replaced the page's on every later pull. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
fd89381caa
commit
31abad4c8e
5 files changed
+69
-6
No files matched your search
@@ -328,6 +328,30 @@ def test_detail_is_read_for_unread_roles_only(
|
||||
assert state["ats:complete:fake:acme"] == "1"
|
||||
|
||||
|
||||
def test_a_role_read_on_an_earlier_pull_keeps_the_place_its_page_gave(
|
||||
monkeypatch: pytest.MonkeyPatch, web: dict[str, Any]) -> None:
|
||||
"""The listing states a place on every pull, and a filled value replaces
|
||||
a filled column, so for a role already read it is withheld."""
|
||||
base = "https://jobs.fake.example/acme"
|
||||
web["answers"].update({f"{base}/list": b'["1", "2", "3"]', f"{base}/2": b"two in full",
|
||||
f"{base}/3": RuntimeError("down")})
|
||||
module = _fake_host(detail=lambda get, slug, row: {
|
||||
"description": get(f"{base}/{row['source_id']}").decode()})
|
||||
listing = module.parse
|
||||
module.parse = lambda body, slug: [row | {"location": "2 Locations", "remote": "hybrid"}
|
||||
for row in listing(body, slug)]
|
||||
state = {"ats:detailed:fake:acme": json.dumps(["fake:acme:1"]),
|
||||
"ats:detailfailed:fake:acme": json.dumps(["fake:acme:3"])}
|
||||
items, _state = _run(monkeypatch, module, state)
|
||||
|
||||
by_id = {i.source_id: (i.body, i.raw["place"], i.raw["remote"]) for i in items}
|
||||
assert by_id["fake:acme:1"] == ("", "", None)
|
||||
# Read now, and its page stated neither: the listing's stand.
|
||||
assert by_id["fake:acme:2"] == ("two in full", "2 Locations", "hybrid")
|
||||
# Never read: the listing's stand until its page is.
|
||||
assert by_id["fake:acme:3"] == ("", "2 Locations", "hybrid")
|
||||
|
||||
|
||||
def test_detail_reads_stop_at_the_cap_and_the_rest_wait(
|
||||
monkeypatch: pytest.MonkeyPatch, web: dict[str, Any]) -> None:
|
||||
base = "https://jobs.fake.example/acme"
|
||||
|
||||
Reference in new issue
Block a user