Order the hosts by a RANK per module, which restores the select's and the probes' order from before the modules

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-29 19:38:18 +02:00
1 parent 75a389d725
commit a9fb4397ac
11 files changed
+71 -8

No files matched your search

+23
View File
@@ -268,6 +268,29 @@ def test_slug_probes_find_a_board_the_pages_never_link() -> None:
assert found.evidence == "https://api.ashbyhq.com/posting-api/job-board/acme"
@pytest.mark.parametrize(("boards", "found"), [
({("greenhouse", "acme"), ("ashby", "acme")}, "greenhouse:acme"),
({("lever", "acme"), ("ashby", "acme")}, "lever:acme"),
({("smartrecruiters", "acme"), ("personio", "acme")}, "smartrecruiters:acme"),
({("lever", "eu/acme"), ("personio", "acme")}, "lever:eu/acme"),
])
def test_a_slug_on_two_hosts_goes_to_the_one_probed_first(
boards: set[tuple[str, str]], found: str) -> None:
site = Site({}, boards=boards)
assert run(site).board == found
def test_the_probe_order_is_the_one_before_modules() -> None:
assert list(mod._PROBES)[:7] == ["greenhouse", "lever", "ashby", "smartrecruiters",
"recruitee", "personio", "teamtailor"]
site = Site({})
run(site)
assert site.probed[:8] == [("greenhouse", "acme"), ("lever", "acme"), ("lever", "eu/acme"),
("ashby", "acme"), ("smartrecruiters", "acme"),
("recruitee", "acme"), ("personio", "acme"),
("teamtailor", "acme")]
def test_a_lever_eu_board_is_found_by_its_probe() -> None:
site = Site({"https://acme.com/": "<p>a script draws the jobs</p>"},
boards={("lever", "eu/acme")})