Say remote not asked on the Companies line, show a failing search on its row, forget a removed search's record, and mark a read that asked nothing as not closing

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Fable 5.1 committed 2026-09-30 16:11:27 +02:00
1 parent 0ad47605fd
commit a63eed2e56
10 files changed
+66 -36

No files matched your search

+5 -5
View File
@@ -307,7 +307,7 @@ WORKDAY = "workday:acme.wd3/Jobs"
"follows agents: DK, remote · SE not on this site · all roles"),
({"country": {"DE": "c=de"}, "remote": {"remote": "r=1"}},
"follows agents: remote · DK, SE not on this site · all roles"),
({"country": {"DE": "c=de"}}, "site lists none of DK, SE, remote: nothing asked"),
({"country": {"DE": "c=de"}}, "site lists none of DK, SE, remote: nothing asked, not closing"),
], ids=["none kept", "all known", "one country, no remote", "one country and remote",
"remote only", "none"])
def test_the_line_names_what_a_site_does_not_know(
@@ -322,7 +322,7 @@ def test_the_line_names_what_a_site_does_not_know(
assert reach.line(plan, sub) == line
# What the line says is left to ask is what the runner asks.
ask = _runner.ask_for(workday, sub.params, plan.for_subscription(sub))
assert (_runner.series(workday, ask, facets) == []) == line.endswith("nothing asked")
assert (_runner.series(workday, ask, facets) == []) == line.endswith("nothing asked, not closing")
def test_the_line_says_nothing_is_asked_in_the_plans_words(store: Store) -> None:
@@ -331,7 +331,7 @@ def test_the_line_says_nothing_is_asked_in_the_plans_words(store: Store) -> None
store.state[f"ats:facets:{WORKDAY}"] = json.dumps(
{"checked": "2026-09-30T06:00:00+00:00", "facets": {"country": {"DE": "c=de"}}})
assert reach.line(reach.plan(store), _sub(store, WORKDAY)) == \
"site lists none of DK, SE: nothing asked"
"site lists none of DK, SE: nothing asked, not closing"
def test_a_boards_own_reach_is_named_the_same_and_remote_alone_is_read_whole(
@@ -378,7 +378,7 @@ def test_recheck_sizes_the_board_again_and_queues_a_pull(
res = client.post(f"/api/sources/{sub_id}/size")
assert res.status_code == 200, res.text
assert res.json() == {"size": 4830, "size_checked": TODAY,
"reach": "follows agents: DK, SE · all roles"}
"reach": "follows agents: DK, SE · remote not asked on SmartRecruiters · all roles"}
assert app.state.queue.jobs.last("pull", states=("queued", "running", "done")) is not None
[row] = client.get("/api/companies").json()
assert (row["size"], row["size_checked"]) == (4830, TODAY)
@@ -408,7 +408,7 @@ def test_the_cli_sizes_one_board_or_every_board_without_a_size(
monkeypatch.setattr(ats, "_get", SmartRecruiters(4830))
assert _cli(tmp_path, "size", "bosch") == 0
assert json.loads(capsys.readouterr().out) == {
"board": BOSCH, "size": 4830, "reach": "follows agents: DK, SE · all roles"}
"board": BOSCH, "size": 4830, "reach": "follows agents: DK, SE · remote not asked on SmartRecruiters · all roles"}
def some(client: Any, url: str, host: str, slug: str, **kwargs: Any) -> bytes:
if slug == "gone":
+2 -2
View File
@@ -123,7 +123,7 @@ def test_the_narrow_reach_takes_no_terms(store: Store) -> None:
sub = _sub(store, "smartrecruiters:BoschGroup")
ask = _runner.ask_for(smartrecruiters, sub.params, plan.for_subscription(sub))
assert ask == Ask(countries=("DK", "SE"))
assert reach.line(plan, sub) == "follows agents: DK, SE · all roles"
assert reach.line(plan, sub) == "follows agents: DK, SE · remote not asked on SmartRecruiters · all roles"
@pytest.mark.parametrize("size, params", [
@@ -240,7 +240,7 @@ def test_the_reach_line_counts_the_terms(store: Store) -> None:
plan = reach.plan(store)
philips = _sub(store, "phenom:www.careers.philips.com/global/en")
assert reach.line(plan, philips) == \
"all countries (Europe) · follows agents' terms: data, engineer, head of"
"all countries (Europe) · remote not asked on Phenom · follows agents' terms: data, engineer, head of"
assert reach.line(plan, _sub(store, "smartrecruiters:BoschGroup")) == \
"all places, too many countries to ask · follows agents' terms: data, engineer, head of"
+4 -4
View File
@@ -51,10 +51,10 @@ def _read(store: Store, target: str) -> tuple[Ask, str]:
@pytest.mark.parametrize("countries, roles, line", [
(False, False, "follows agents: DK, SE · all roles"),
(False, True, "follows agents: DK, SE · all roles"),
(True, False, "all countries (Europe) · follows agents' terms: data, engineer, product"),
(True, True, "all countries (Europe) · all roles"),
(False, False, "follows agents: DK, SE · remote not asked on Phenom · all roles"),
(False, True, "follows agents: DK, SE · remote not asked on Phenom · all roles"),
(True, False, "all countries (Europe) · remote not asked on Phenom · follows agents' terms: data, engineer, product"),
(True, True, "all countries (Europe) · remote not asked on Phenom · all roles"),
], ids=["neither", "all roles alone", "all countries alone", "both"])
def test_the_four_combinations(store: Store, countries: bool, roles: bool, line: str) -> None:
_board(store, PHILIPS, "Philips")
+1 -1
View File
@@ -146,7 +146,7 @@ def test_a_tag_asks_phenom_for_europe_in_one_request(store: Store) -> None:
store.set_all_countries("mistral-ai", True)
[sub] = store.subscriptions(source="ats")
found = reach.plan(store)
assert reach.line(found, sub) == "all countries (Europe) · all roles"
assert reach.line(found, sub) == "all countries (Europe) · remote not asked on Phenom · all roles"
def test_an_agent_without_a_required_place_makes_the_tag_everywhere(store: Store) -> None:
+5 -5
View File
@@ -53,7 +53,7 @@ def _row(client: TestClient) -> dict[str, object]:
def test_a_company_row_says_what_its_board_is_asked_for(client: TestClient, bosch: int) -> None:
row = _row(client)
# SmartRecruiters cannot ask for remote, so only the country is asked.
assert (row["reach"], row["reach_params"]) == ("follows agents: DK · all roles", {})
assert (row["reach"], row["reach_params"]) == ("follows agents: DK · remote not asked on SmartRecruiters · all roles", {})
def test_a_boards_own_reach_is_kept_in_its_params_and_wins(
@@ -61,14 +61,14 @@ def test_a_boards_own_reach_is_kept_in_its_params_and_wins(
res = client.post(f"/api/sources/{bosch}/reach",
json={"mode": "own", "countries": ["de", "se"], "remote": True})
assert res.status_code == 200, res.text
assert res.json()["reach"] == "set here: DE, SE · all roles"
assert res.json()["reach"] == "set here: DE, SE · remote not asked on SmartRecruiters · all roles"
sub = store.subscription(bosch)
assert sub is not None
assert sub.params == {"note": "kept", "countries": ["DE", "SE"], "remote": True}
assert _row(client)["reach_params"] == {"countries": ["DE", "SE"], "remote": True}
res = client.post(f"/api/sources/{bosch}/reach", json={"mode": "agents"})
assert res.json()["reach"] == "follows agents: DK · all roles"
assert res.json()["reach"] == "follows agents: DK · remote not asked on SmartRecruiters · all roles"
assert store.subscription(bosch).params == {"note": "kept"} # type: ignore[union-attr]
@@ -123,7 +123,7 @@ def test_all_roles_is_its_own_switch_and_on_queues_a_pull(
row = _row(client)
# The narrow reach takes no terms, so on its own it changes nothing today.
assert (row["all_countries"], row["all_roles"], row["reach"]) == (
False, True, "follows agents: DK · all roles")
False, True, "follows agents: DK · remote not asked on SmartRecruiters · all roles")
@pytest.mark.parametrize("path, setter", [("all-countries", "set_all_countries"),
@@ -136,7 +136,7 @@ def test_turning_an_override_off_queues_nothing(
assert res.status_code == 200
assert (res.json()["all_countries"], res.json()["all_roles"]) == (0, 0)
assert app.state.queue.jobs.last("pull", states=_ANY_STATE) is None
assert _row(client)["reach"] == "follows agents: DK · all roles"
assert _row(client)["reach"] == "follows agents: DK · remote not asked on SmartRecruiters · all roles"
assert client.post(f"/api/companies/nobody/{path}", json={"on": True}).status_code == 404