job-research/tests/profile/test_profile_parser.py
2026-05-28 14:02:32 +02:00

75 lines
1.8 KiB
Python

import pytest
from textwrap import dedent
from job_research.profile.profile_parser import parse_profile_markdown
def test_parse_profile_markdown_reads_light_required_template() -> None:
markdown = dedent(
"""
# Candidate Profile
## Summary
Junior data engineer focused on Python and GCP.
## Target Roles
* Data Engineer
+ Analytics Engineer
## Strengths
- Python
- SQL
## Skills To Emphasize
- BigQuery
- Terraform
## Constraints
- CDI only
- France only
## Notes
Slight preference for French listings.
"""
).strip()
profile = parse_profile_markdown(markdown)
assert profile.summary == "Junior data engineer focused on Python and GCP."
assert profile.target_roles == ["Data Engineer", "Analytics Engineer"]
assert profile.strengths == ["Python", "SQL"]
assert profile.skills_to_emphasize == ["BigQuery", "Terraform"]
assert profile.constraints == ["CDI only", "France only"]
assert profile.notes == ["Slight preference for French listings."]
def test_parse_profile_markdown_rejects_unsupported_list_content() -> None:
markdown = dedent(
"""
# Candidate Profile
## Summary
Junior data engineer focused on Python and GCP.
## Target Roles
- Data Engineer
Analytics Engineer
## Strengths
- Python
## Skills To Emphasize
- BigQuery
## Constraints
- CDI only
## Notes
- Slight preference for French listings.
"""
).strip()
with pytest.raises(ValueError, match="Unsupported content in section 'target roles'"):
parse_profile_markdown(markdown)