Readers oracle to workday and the providers hand on the host's words; their word tables move to app/prep/hosts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-30 11:07:07 +02:00
1 parent a66aac95cf
commit 06eb929eaf
48 files changed
+460 -388

No files matched your search

+5 -19
View File
@@ -3,17 +3,14 @@ No network: the fixtures are saved feeds."""
from __future__ import annotations
import logging
import sys
from pathlib import Path
import pytest
ROOT = Path(__file__).resolve().parents[1]
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
from app.models import SENIORITIES # noqa: E402
from plugins.readers import Ask, personio # noqa: E402
FIXTURES = ROOT / "tests" / "fixtures" / "ats"
@@ -37,23 +34,12 @@ def test_additional_offices_are_places_of_the_role_each_once() -> None:
assert [p["text"] for p in first["places"]] == ["Remote - Germany", "Berlin", "Hamburg"]
assert [p["remote"] for p in first["places"]] == [True, None, None]
assert first["location"] == "Remote - Germany; Berlin; Hamburg"
assert first["remote"] is True # one of the places is remote
assert "remote" not in first # the feed states none
assert _rows()[1]["places"] == [{"text": "Munich", "remote": None}]
assert _rows()[1]["remote"] is None
def test_the_stated_level_and_employment_are_mapped() -> None:
def test_the_stated_level_and_employment_are_the_hosts_words() -> None:
rows = _rows()
assert [r["seniority"] for r in rows] == ["junior", "exec", "intern"]
# permanent + full-time; permanent + full-time; working student wins over part-time
assert [r["employment"] for r in rows] == ["full_time", "full_time", "internship"]
def test_the_table_speaks_the_apps_vocabulary_and_a_new_word_is_logged(
caplog: pytest.LogCaptureFixture) -> None:
assert {v for v in personio._SENIORITY.values() if v} <= set(SENIORITIES)
with caplog.at_level(logging.DEBUG, logger=personio.__name__):
assert personio._seniority("wizard") is None
assert personio._seniority("experienced") is None # known, names no level
assert personio._seniority("") is None
assert [r.getMessage() for r in caplog.records] == ["personio: unknown seniority 'wizard'"]
assert [r["seniority"] for r in rows] == ["entry-level", "executive", "student"]
# permanent + full-time gives the schedule; a working student is the contract's word
assert [r["employment"] for r in rows] == ["full-time", "full-time", "working_student"]