from_title matches a title twice, for the highest people level and the highest individual grade. A people level wins on its own rung; a grade above that rung lifts it one rung (Principal Engineering Manager is a senior manager). Senior Staff is principal, Senior Principal, Distinguished and Technical Fellow are distinguished; Associate Director, AVP and Senior Manager are senior managers. lead is now a team lead only (Team Lead, Shift Lead, Supervisor, Teamleiter); Tech Lead, Lead X and X Lead(er) are staff. A slash names two levels, so Senior/Staff is staff. - Jobylon "lead" maps to staff; Recruitee maps student_college, manager, senior_manager and executive. - extract's prompt describes the ladder and its two tracks; enum from LEVELS. - prep VERSION 2, so the next prep maps every open role again. - Migration 25 clears seniority_model where it is staff, lead, manager or director, so extract reads those roles again, and sets roles.seniority to the first filled of model, stated and title. - The coverage test of tests/test_seniority.py passes; its xfail is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
43 lines
1.6 KiB
Python
43 lines
1.6 KiB
Python
"""The jobylon words, mapped to the app's vocabulary."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import importlib
|
|
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 import models # noqa: E402
|
|
from plugins.readers._shared import EMPLOYMENTS # noqa: E402
|
|
|
|
hosts = importlib.import_module("app.prep.hosts.jobylon")
|
|
|
|
VOCABULARY = {"SENIORITY": models.SENIORITIES, "EMPLOYMENT": EMPLOYMENTS, "REMOTE": models.REMOTE}
|
|
|
|
|
|
@pytest.mark.parametrize("table", ['SENIORITY', 'EMPLOYMENT', 'REMOTE'])
|
|
def test_the_table_keys_are_lowercase_and_the_values_in_the_vocabulary(table: str) -> None:
|
|
words = getattr(hosts, table)
|
|
assert all(key == key.strip().lower() for key in words)
|
|
assert set(words.values()) <= {*VOCABULARY[table], ""}
|
|
|
|
|
|
@pytest.mark.parametrize(("word", "value"), [('mid level', 'mid'), ('student', 'intern'), ('entry level', 'junior'), ('executive', 'exec'), ('not applicable', ''), ('lead', 'staff'), ('manager', 'manager')])
|
|
def test_seniority_words(word: str, value: str) -> None:
|
|
assert hosts.SENIORITY[word] == value
|
|
|
|
|
|
@pytest.mark.parametrize(("word", "value"), [('full-time', 'full_time'), ('consultant', 'contract'), ('summer job', 'temporary')])
|
|
def test_employment_words(word: str, value: str) -> None:
|
|
assert hosts.EMPLOYMENT[word] == value
|
|
|
|
|
|
@pytest.mark.parametrize(("word", "value"), [('remote', 'remote'), ('hybrid', 'hybrid'), ('on-site', 'onsite')])
|
|
def test_remote_words(word: str, value: str) -> None:
|
|
assert hosts.REMOTE[word] == value
|