35 lines
1.1 KiB
Python
35 lines
1.1 KiB
Python
from job_research.apec.normalize import normalize_apec_listing
|
|
|
|
|
|
def test_normalize_apec_listing_extracts_minimal_shape() -> None:
|
|
html = """
|
|
<html>
|
|
<body>
|
|
<h1><span>Data</span> <strong>Engineer</strong></h1>
|
|
<div class="company"><span>Example</span> <em>Corp</em></div>
|
|
<div class="location">Paris</div>
|
|
<div class="contract">CDI</div>
|
|
<div class="description">Build pipelines</div>
|
|
</body>
|
|
</html>
|
|
"""
|
|
|
|
listing = normalize_apec_listing(
|
|
url="https://example.test/job/123",
|
|
html=html,
|
|
fetched_at="2026-06-01T10:00:00Z",
|
|
source_job_id="job-123",
|
|
published_at="2026-05-31",
|
|
)
|
|
|
|
assert listing.source == "apec"
|
|
assert listing.source_job_id == "job-123"
|
|
assert listing.url == "https://example.test/job/123"
|
|
assert listing.title == "Data Engineer"
|
|
assert listing.company == "Example Corp"
|
|
assert listing.location == "Paris"
|
|
assert listing.contract_type == "CDI"
|
|
assert listing.description_text == "Build pipelines"
|
|
assert listing.published_at == "2026-05-31"
|
|
assert listing.fetched_at == "2026-06-01T10:00:00Z"
|