feat: add Apec adapter scaffold
This commit is contained in:
parent
5fefa3aab1
commit
47619abc08
20
src/job_research/apec/adapter.py
Normal file
20
src/job_research/apec/adapter.py
Normal file
@ -0,0 +1,20 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class ApecSearchResult:
|
||||
url: str
|
||||
source_job_id: str | None = None
|
||||
|
||||
|
||||
class ApecAdapter:
|
||||
def __init__(self, max_listings: int = 50) -> None:
|
||||
self.max_listings = max_listings
|
||||
|
||||
def search(self, queries: list[str]) -> list[ApecSearchResult]:
|
||||
return []
|
||||
|
||||
def fetch_listing_html(self, url: str) -> str:
|
||||
return ""
|
||||
@ -45,3 +45,13 @@ def test_apec_run_paths_builds_expected_layout(tmp_path: Path) -> None:
|
||||
assert paths["listings"] == run_dir / "listings.yaml"
|
||||
assert paths["run_meta"] == run_dir / "run-meta.yaml"
|
||||
assert paths["snapshots"] == run_dir / "snapshots"
|
||||
|
||||
|
||||
def test_apec_run_artifacts_include_snapshot_and_meta(tmp_path: Path) -> None:
|
||||
paths = apec_run_paths(tmp_path, run_id="2026-06-01T10-00-00Z")
|
||||
paths["snapshots"].mkdir(parents=True, exist_ok=True)
|
||||
|
||||
snapshot = paths["snapshots"] / "job-123.html"
|
||||
snapshot.write_text("<html>snapshot</html>", encoding="utf-8")
|
||||
|
||||
assert snapshot.read_text(encoding="utf-8") == "<html>snapshot</html>"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user