Merge board size set once, Recheck, and the Companies line naming what a site does not know (wp-a-size)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-30 13:45:27 +02:00
commit 8c66aeb445
11 files changed
+786 -70

No files matched your search

+9 -8
View File
@@ -603,7 +603,8 @@ def test_companies_lists_board_and_open_role_count(
"careers_opened_at": "", "failing_since": "", "failing_reason": "",
"from_search": False, "hand_reason": "", "by_hand": False,
"all_countries": False, "all_roles": False,
"reach_params": {}, "reach": "size not known yet: read whole"}
"reach_params": {}, "reach": "size not known yet: sized on the next pull",
"size": None, "size_checked": ""}
[other] = [c for c in res.json() if c["key"] == "other"]
assert (other["board"], other["subscription_id"], other["on"], other["ats"]) == (
"", None, None, "")
@@ -1371,7 +1372,7 @@ def test_a_board_is_followed_only_if_it_answers(
client: TestClient, store: Store, queue: Any, monkeypatch: pytest.MonkeyPatch) -> None:
import plugins.ats as ats
monkeypatch.setattr(ats, "fetch_board", lambda target: ([{"source_id": "1"}], True))
monkeypatch.setattr(ats, "board_size", lambda target, **kw: 1)
res = client.post("/api/boards", json={"board": "ashby:acme", "name": "Acme"})
assert res.status_code == 201
assert res.json()["found"] == 1 and res.json()["source"]["target"] == "ashby:acme"
@@ -1389,10 +1390,10 @@ def test_a_board_is_followed_only_if_it_answers(
bad = client.post("/api/boards", json={"board": "acme", "name": "Other"})
assert bad.status_code == 422 and "host:slug" in bad.json()["detail"]
def down(target: str) -> list[dict[str, str]]:
def down(target: str, **kw: object) -> int:
raise OSError("connection refused")
monkeypatch.setattr(ats, "fetch_board", down)
monkeypatch.setattr(ats, "board_size", down)
dead = client.post("/api/boards", json={"board": "ashby:other", "name": "Other"})
assert dead.status_code == 422 and "did not answer" in dead.json()["detail"]
assert store.company("other") is None
@@ -1402,7 +1403,7 @@ def test_a_companys_board_is_set_replaced_and_detached(
client: TestClient, store: Store, queue: Any, monkeypatch: pytest.MonkeyPatch) -> None:
import plugins.ats as ats
monkeypatch.setattr(ats, "fetch_board", lambda target: ([], True)) # between openings
monkeypatch.setattr(ats, "board_size", lambda target, **kw: 0) # between openings
store.add_company("Acme", key="acme", ats="teamtailor", ats_slug="acme")
res = client.post("/api/companies/acme/board", json={"board": "greenhouse:acme"})
@@ -1453,7 +1454,7 @@ def test_a_company_is_added_by_hand_with_a_reason_and_a_link(
"country": "", "city": "", "watch": None, "careers_opened_at": "",
"failing_since": "", "failing_reason": "", "from_search": False,
"hand_reason": "added", "by_hand": True, "all_countries": False, "all_roles": False,
"reach_params": {}, "reach": ""}
"reach_params": {}, "reach": "", "size": None, "size_checked": ""}
assert store.company("revolut").hand_reason == "added" # type: ignore[union-attr]
other = client.post("/api/companies", json={"name": "Meta", "hand_reason": "blocked"})
@@ -1522,7 +1523,7 @@ def test_a_company_with_a_board_keeps_its_name_and_takes_the_other_edits(
client: TestClient, store: Store, monkeypatch: pytest.MonkeyPatch) -> None:
import plugins.ats as ats
monkeypatch.setattr(ats, "fetch_board", lambda target: ([], True))
monkeypatch.setattr(ats, "board_size", lambda target, **kw: 0)
store.add_company("Acme", key="acme")
assert client.post("/api/companies/acme/board", json={"board": "greenhouse:acme"}
).status_code == 200
@@ -1563,7 +1564,7 @@ def test_a_company_is_deleted_unless_it_is_read(
client: TestClient, store: Store, monkeypatch: pytest.MonkeyPatch) -> None:
import plugins.ats as ats
monkeypatch.setattr(ats, "fetch_board", lambda target: ([], True))
monkeypatch.setattr(ats, "board_size", lambda target, **kw: 0)
agent = store.save_agent("A")
store.add_company("Meta", key="meta", hand_reason="blocked")
store.set_affinity(agent.id, "meta", 1)