31 lines
948 B
Python
31 lines
948 B
Python
from job_research.apec.normalize import normalize_apec_listing
|
|
|
|
|
|
def test_normalize_apec_listing_extracts_minimal_shape() -> None:
|
|
html = """
|
|
<html>
|
|
<body>
|
|
<h1>Data Engineer</h1>
|
|
<div class="company">Example Corp</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",
|
|
)
|
|
|
|
assert listing.source == "apec"
|
|
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.fetched_at == "2026-06-01T10:00:00Z"
|