Readers ashby to lever 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:
1 parent
a66aac95cf
commit
6c7ce1090d
37 files changed
+504
-171
No files matched your search
@@ -14,7 +14,6 @@ ROOT = Path(__file__).resolve().parents[1]
|
||||
if str(ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
from app import models as app_models # noqa: E402
|
||||
from app.jobs.discover import boards_in # noqa: E402
|
||||
from plugins import ats, readers # noqa: E402
|
||||
from plugins.readers import Ask, jobylon # noqa: E402
|
||||
@@ -36,20 +35,20 @@ def test_rows_come_from_the_embeds_literal() -> None:
|
||||
assert first["location"] == "Stockholm"
|
||||
assert first["places"] == [{"text": "Stockholm", "remote": None}]
|
||||
assert first["department"] == "Accounting & Finance" # `&` read as `&`
|
||||
assert first["remote"] == "hybrid"
|
||||
assert first["remote"] == "Hybrid"
|
||||
assert first["description"] == "" and first["salary_text"] == ""
|
||||
# A day, with no time of day: the embed says "Sept. 25, 2026".
|
||||
assert first["posted"] is not None and first["posted"].isoformat() == \
|
||||
"2026-09-25T00:00:00+00:00"
|
||||
|
||||
|
||||
def test_places_department_and_remote_follow_the_embeds_words() -> None:
|
||||
def test_places_department_and_remote_are_the_embeds_words() -> None:
|
||||
rows = {r["source_id"]: r for r in jobylon.parse(BOARD, "3143")}
|
||||
assert rows["384238"]["location"] == "Houston; Dallas; Atlanta"
|
||||
assert [p["text"] for p in rows["384238"]["places"]] == ["Houston", "Dallas", "Atlanta"]
|
||||
assert rows["384238"]["department"] == "" # "All functions" names none
|
||||
assert rows["382124"]["remote"] == "remote"
|
||||
assert rows["382860"]["remote"] == "onsite"
|
||||
assert rows["382124"]["remote"] == "Remote"
|
||||
assert rows["382860"]["remote"] == "On-site"
|
||||
assert rows["380347"]["remote"] is None # a role with no workspace
|
||||
|
||||
|
||||
@@ -130,18 +129,14 @@ def test_an_empty_board_is_no_roles() -> None:
|
||||
assert jobylon.parse(EMPTY, "1056") == []
|
||||
|
||||
|
||||
def test_the_experience_is_mapped_and_a_word_the_table_lacks_is_logged(
|
||||
caplog: pytest.LogCaptureFixture) -> None:
|
||||
caplog.set_level("DEBUG", logger="plugins.readers.jobylon")
|
||||
def test_the_experience_and_the_employment_type_are_the_hosts_words() -> None:
|
||||
rows = {r["source_id"]: r for r in jobylon.parse(BOARD, "3143")}
|
||||
assert rows["384238"]["seniority"] == "mid" # "Mid level"
|
||||
assert "seniority" not in rows["385191"] # "Experienced" says too little
|
||||
assert "unknown experience 'Experienced'" in caplog.text
|
||||
assert rows["385191"]["employment"] == "full_time"
|
||||
assert all(r.get("seniority", "mid") in app_models.SENIORITIES for r in rows.values())
|
||||
assert rows["384238"]["seniority"] == "Mid level"
|
||||
assert rows["385191"]["seniority"] == "Experienced"
|
||||
assert rows["385191"]["employment"] == "Full-time"
|
||||
rows = {r["source_id"]: r for r in jobylon.parse(
|
||||
(FIXTURES / "jobylon-places.html").read_bytes(), "3143")}
|
||||
assert rows["502"]["seniority"] == "intern" and rows["502"]["employment"] == "internship"
|
||||
assert rows["502"]["seniority"] == "Student" and rows["502"]["employment"] == "Internship"
|
||||
|
||||
|
||||
def test_a_summary_is_the_teaser_unless_the_embed_says_none() -> None:
|
||||
|
||||
Reference in new issue
Block a user