53 lines
1.9 KiB
Python
53 lines
1.9 KiB
Python
from job_research.profile.merge import build_candidate_profile_output
|
|
from job_research.profile.profile_parser import AuthoredProfile
|
|
|
|
|
|
def test_build_candidate_profile_output_writes_warning_when_facts_conflict() -> None:
|
|
cv_signals = {
|
|
"name": "Tonio",
|
|
"location": "France",
|
|
"languages": ["French", "English"],
|
|
"skills": ["Python", "SQL"],
|
|
"experience_entries": [{"title": "Data Engineer", "company": "A"}],
|
|
"education_entries": [],
|
|
"years_of_experience": 2,
|
|
}
|
|
authored = AuthoredProfile(
|
|
summary="Junior data engineer focused on GCP.",
|
|
target_roles=["Data Engineer"],
|
|
strengths=["Python"],
|
|
skills_to_emphasize=["BigQuery", "GCP"],
|
|
constraints=["CDI only"],
|
|
notes=["Years of experience feels closer to 3."],
|
|
)
|
|
|
|
output = build_candidate_profile_output(cv_signals, authored)
|
|
|
|
assert output.summary == "Junior data engineer focused on GCP."
|
|
assert output.constraints == ["CDI only"]
|
|
assert output.warnings[0].field == "years_of_experience"
|
|
|
|
|
|
def test_build_candidate_profile_output_writes_warning_for_french_experience_note() -> None:
|
|
cv_signals = {
|
|
"name": "Tonio",
|
|
"location": "France",
|
|
"languages": ["French", "English"],
|
|
"skills": ["Python", "SQL"],
|
|
"experience_entries": [{"title": "Data Engineer", "company": "A"}],
|
|
"education_entries": [],
|
|
"years_of_experience": 2,
|
|
}
|
|
authored = AuthoredProfile(
|
|
summary="Junior data engineer focused on GCP.",
|
|
target_roles=["Data Engineer"],
|
|
strengths=["Python"],
|
|
skills_to_emphasize=["BigQuery", "GCP"],
|
|
constraints=["CDI only"],
|
|
notes=["Années d'expérience semble plus proche de 3."],
|
|
)
|
|
|
|
output = build_candidate_profile_output(cv_signals, authored)
|
|
|
|
assert output.warnings[0].field == "years_of_experience"
|