Files
jobboard/tests/test_ats_teamtailor.py
T
WolfandClaude Opus 5.5 4316624769 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>
2026-09-30 09:14:27 +02:00

51 lines
2.0 KiB
Python

"""Teamtailor: every location of a role, kept as a place. No network: the
fixture is the trimmed feed of Kry and Tobii, read on 2026-09-29."""
from __future__ import annotations
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
from plugins.readers import Ask, teamtailor # noqa: E402
FIXTURES = ROOT / "tests" / "fixtures" / "ats"
def _rows() -> list[dict]:
return teamtailor.parse((FIXTURES / "teamtailor-places.xml").read_bytes(), "kry")
def test_the_declaration_says_what_the_feed_gives() -> None:
reads = teamtailor.READS
assert (reads.listing, reads.page_size, reads.places, reads.text, reads.complete) == \
("paged", 50, "many", "listing", "end")
assert reads.fields.posted == "trusted" and reads.fields.remote == "stated"
assert reads.robots.startswith("api: no robots.txt check needed")
assert not hasattr(teamtailor, "robots_page")
def test_page_takes_the_ask_and_reads_the_same_url() -> None:
asked: list[str] = []
def get(url: str, **_: object) -> bytes:
asked.append(url)
return (FIXTURES / "teamtailor-places.xml").read_bytes()
_items, results, total, cursor = teamtailor.page(get, "kry", None, Ask())
assert asked == ["https://kry.teamtailor.com/jobs.rss?per_page=50&offset=0"]
assert len(results) == 4 and total is None and cursor == 4
def test_every_distinct_location_is_a_place_with_the_roles_work_mode() -> None:
first, second, third = _rows()
# "Sverige" (a city that is a country) once, Stockholm's twin once.
assert first["places"] == [{"text": "Sverige, Sweden", "remote": False}, # hybrid
{"text": "Stockholm, Sweden", "remote": False}]
assert first["location"] == "Sverige, Sweden; Stockholm, Sweden"
assert second["places"] == [{"text": "Danderyd, Sweden", "remote": True}] # fully
assert third["places"] == [] and third["location"] == ""