Declare READS for Oracle, Personio, Phenom, Pinpoint, Recruitee, Rippling, SmartRecruiters, SuccessFactors, Teamtailor, Workable and Workday
Every row carries places (Personio additionalOffices, Workable and Recruitee locations[], every SuccessFactors address, Workday's own read), the list teaser of Phenom and Oracle is kept in teaser, and the level, employment and country a host states are mapped. Workday "N Locations" and "Country - City", and Recruitee "Remote job", are no longer places. Phenom takes dateCreated as posted. robots_page and ROBOTS_ANY_CASE go; READS.robots records the decision. Signatures are feed_url(slug, ask) and page(get, slug, cursor, ask), with an empty Ask as the default so the runner of today still calls them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4c0da58da7
commit
4316624769
42 files changed
+3126
-199
No files matched your search
@@ -323,13 +323,39 @@ def test_detail_reads_the_description_the_date_and_the_country_code_of_an_addres
|
||||
assert got["posted"] == datetime(2026, 9, 29, 2, tzinfo=UTC)
|
||||
# The locality and the country's name; the region is cut to "Seou" by the site.
|
||||
assert got["location"] == "Seoul, South Korea"
|
||||
assert set(got) <= set(ats.DETAIL_FIELDS)
|
||||
assert got["places"] == [{"text": "Seoul, South Korea", "remote": None}]
|
||||
assert got["country"] == "KR"
|
||||
|
||||
|
||||
def test_detail_keeps_every_address_of_a_role_at_several_places() -> None:
|
||||
"""The page repeats the `jobLocation` block per place; the last one used to win."""
|
||||
got = _detail("successfactors-places-detail.html")
|
||||
assert [p["text"] for p in got["places"]] == [
|
||||
"Seoul, South Korea", "Busan, South Korea", "Aarhus, Denmark"]
|
||||
assert got["location"] == "Seoul, South Korea; Busan, South Korea; Aarhus, Denmark"
|
||||
assert "country" not in got # KR and DK: no single country for the role
|
||||
|
||||
|
||||
def test_detail_states_the_country_when_every_address_is_in_it() -> None:
|
||||
text = _read("successfactors-places-detail.html").replace(
|
||||
'content="Aarhus, DK, 8200"', 'content="Daegu, KR, 41200"')
|
||||
got = successfactors.detail(lambda url, **kw: text.encode(), "careers.vestas.com",
|
||||
{"url": "https://careers.vestas.com/job/x/1/"})
|
||||
assert got["country"] == "KR"
|
||||
|
||||
|
||||
def test_the_listing_place_is_the_roles_only_place_until_its_page_is_read() -> None:
|
||||
rows = successfactors.rows(_read("successfactors-table.html"), "careers.vestas.com")
|
||||
assert rows[0]["places"] == [{"text": "Seoul, Seoul-teukpyolsi, South Korea", "remote": None}]
|
||||
assert all(r["places"] == ([{"text": r["location"], "remote": None}] if r["location"] else [])
|
||||
for r in rows)
|
||||
|
||||
|
||||
def test_detail_reads_the_country_from_a_street_address() -> None:
|
||||
"""Systematic and most other sites give one `streetAddress`, "City, CC, zip"."""
|
||||
got = _detail("successfactors-job-street.html")
|
||||
assert got["location"] == "Bern, Switzerland"
|
||||
assert got["country"] == "CH"
|
||||
assert got["posted"] == datetime(2026, 9, 28, 2, tzinfo=UTC)
|
||||
assert got["description"].startswith("Senior Solution Engineer Defence")
|
||||
|
||||
@@ -426,15 +452,16 @@ def test_a_redirect_to_the_back_end_is_refused() -> None:
|
||||
"careers.vestas.com")
|
||||
|
||||
|
||||
def test_careers_url_and_robots_page_are_the_search_page() -> None:
|
||||
def test_careers_url_is_the_search_page() -> None:
|
||||
assert ats.careers_url("successfactors:careers.vestas.com") == \
|
||||
"https://careers.vestas.com/search/"
|
||||
assert ats.careers_url("successfactors:jobs.teradyne.com/MiR") == \
|
||||
"https://jobs.teradyne.com/MiR/search/"
|
||||
for slug in GOOD:
|
||||
page = successfactors.robots_page(slug)
|
||||
page = successfactors.careers_url(slug)
|
||||
assert httpx.URL(page).host == slug.split("/")[0]
|
||||
assert successfactors.allowed(slug)(httpx.URL(page).host)
|
||||
assert not hasattr(successfactors, "robots_page") # decided when built, see READS.robots
|
||||
|
||||
|
||||
def test_the_module_is_case_sensitive_about_the_prefix() -> None:
|
||||
@@ -443,24 +470,6 @@ def test_the_module_is_case_sensitive_about_the_prefix() -> None:
|
||||
assert successfactors._parts("jobs.teradyne.com/MiR") == ("jobs.teradyne.com", "/MiR")
|
||||
|
||||
|
||||
# ------------------------------------------------------------------ robots
|
||||
|
||||
def test_the_robots_txt_of_these_sites_allows_search_and_jobs_not_services() -> None:
|
||||
robots = (FIXTURES / "successfactors-robots.txt").read_bytes()
|
||||
for slug in GOOD:
|
||||
assert ats._robots_allows(robots, successfactors.robots_page(slug)), slug
|
||||
assert ats._robots_allows(robots, "https://careers.vestas.com/job/x/1431772533/")
|
||||
assert not ats._robots_allows(robots, "https://careers.vestas.com/services/rss/job/")
|
||||
assert not ats._robots_allows(robots, "https://careers.vestas.com/talentcommunity/apply/1/")
|
||||
|
||||
|
||||
def test_a_site_that_disallows_its_search_is_refused(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
robots = b"User-agent: *\nDisallow: /search/\n"
|
||||
monkeypatch.setattr(ats, "_get", lambda client, url, host, slug, **kw: robots)
|
||||
with pytest.raises(ats._Disallowed):
|
||||
ats._check_robots(object(), "successfactors:careers.acme.com") # type: ignore[arg-type]
|
||||
|
||||
|
||||
# ---------------------------------------------------------------- discovery
|
||||
|
||||
def test_discovery_finds_a_board_from_a_link_to_one_of_its_roles() -> None:
|
||||
|
||||
Reference in new issue
Block a user