Move the eight hosts into a module each under plugins/atshosts and build the ats plugin's tables from them
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0a1d3c67c7
commit
b02b72b4aa
12 files changed
+1296
-789
No files matched your search
+6
-5
@@ -19,6 +19,7 @@ if str(ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
from plugins import ats # noqa: E402
|
||||
from plugins.atshosts import smartrecruiters # noqa: E402
|
||||
|
||||
FIXTURES = ROOT / "tests" / "fixtures" / "ats"
|
||||
|
||||
@@ -384,7 +385,7 @@ def test_is_known_target_accepts_the_eight_hosts_and_refuses_others() -> None:
|
||||
"recruitee", "personio", "teamtailor"):
|
||||
assert ats.is_known_target(f"{host}:acme")
|
||||
assert not ats.is_known_target("linkedin:acme")
|
||||
assert not ats.is_known_target("workday:acme")
|
||||
assert not ats.is_known_target("taleo:acme")
|
||||
assert not ats.is_known_target("greenhouse:")
|
||||
assert not ats.is_known_target("nohostnoseparator")
|
||||
# a Teamtailor slug names a host: its own subdomain, or a whole domain
|
||||
@@ -420,7 +421,7 @@ def test_careers_url_is_filled_per_host_and_empty_for_unknown() -> None:
|
||||
assert ats.careers_url("recruitee:acme") == "https://acme.recruitee.com"
|
||||
assert ats.careers_url("teamtailor:acme") == "https://acme.teamtailor.com/jobs"
|
||||
assert ats.careers_url("teamtailor:careers.acme.com") == "https://careers.acme.com/jobs"
|
||||
assert ats.careers_url("workday:acme") == ""
|
||||
assert ats.careers_url("taleo:acme") == ""
|
||||
|
||||
|
||||
# --------------------------------------------------------------- body cap
|
||||
@@ -570,7 +571,7 @@ def test_smartrecruiters_pages_by_offset_to_total_found(
|
||||
urls.append(url)
|
||||
return _page("smartrecruiters-2.json" if "offset=2" in url else "smartrecruiters.json")
|
||||
|
||||
monkeypatch.setattr(ats, "SMARTRECRUITERS_PAGE", 2)
|
||||
monkeypatch.setattr(smartrecruiters, "PAGE_SIZE", 2)
|
||||
monkeypatch.setattr(ats, "_get", fake_get)
|
||||
rows, complete = ats._fetch_rows(object(), "smartrecruiters:Acme") # type: ignore[arg-type]
|
||||
|
||||
@@ -588,7 +589,7 @@ def test_a_board_that_ends_short_of_its_total_is_incomplete(
|
||||
def fake_get(client, url, host, slug, *, method="GET", payload=None):
|
||||
return empty if "offset=2" in url else _page("smartrecruiters.json")
|
||||
|
||||
monkeypatch.setattr(ats, "SMARTRECRUITERS_PAGE", 2)
|
||||
monkeypatch.setattr(smartrecruiters, "PAGE_SIZE", 2)
|
||||
monkeypatch.setattr(ats, "_get", fake_get)
|
||||
rows, complete = ats._fetch_rows(object(), "smartrecruiters:Acme") # type: ignore[arg-type]
|
||||
assert (len(rows), complete) == (2, False)
|
||||
@@ -604,7 +605,7 @@ def test_a_repeated_row_does_not_count_twice_toward_the_total(
|
||||
page["content"] = page["content"][1:]
|
||||
return json.dumps(page).encode()
|
||||
|
||||
monkeypatch.setattr(ats, "SMARTRECRUITERS_PAGE", 2)
|
||||
monkeypatch.setattr(smartrecruiters, "PAGE_SIZE", 2)
|
||||
monkeypatch.setattr(ats, "_get", fake_get)
|
||||
rows, complete = ats._fetch_rows(object(), "smartrecruiters:Acme") # type: ignore[arg-type]
|
||||
assert (len(rows), complete) == (2, False)
|
||||
|
||||
Reference in new issue
Block a user