feat: add Apec run artifact paths
This commit is contained in:
parent
2765add571
commit
4d57af0b86
@ -21,3 +21,13 @@ def load_yaml(path: Path) -> dict[str, Any]:
|
||||
raise ValueError("candidate-profile YAML root must be a mapping")
|
||||
|
||||
return dict(payload)
|
||||
|
||||
|
||||
def apec_run_paths(data_root: Path, run_id: str) -> dict[str, Path]:
|
||||
run_dir = data_root / "apec" / "runs" / run_id
|
||||
return {
|
||||
"run_dir": run_dir,
|
||||
"listings": run_dir / "listings.yaml",
|
||||
"run_meta": run_dir / "run-meta.yaml",
|
||||
"snapshots": run_dir / "snapshots",
|
||||
}
|
||||
|
||||
@ -1,4 +1,7 @@
|
||||
from pathlib import Path
|
||||
|
||||
from job_research.models import ApecListing, ApecRunMeta, ListingWarning
|
||||
from job_research.storage import apec_run_paths
|
||||
|
||||
|
||||
def test_apec_models_serialize_expected_listing_shape() -> None:
|
||||
@ -32,3 +35,13 @@ def test_apec_models_serialize_expected_listing_shape() -> None:
|
||||
assert listing.model_dump()["source"] == "apec"
|
||||
assert listing.model_dump()["warnings"][0]["field"] == "location"
|
||||
assert run_meta.model_dump()["derived_queries"] == ["Data Engineer"]
|
||||
|
||||
|
||||
def test_apec_run_paths_builds_expected_layout(tmp_path: Path) -> None:
|
||||
paths = apec_run_paths(tmp_path, run_id="2026-06-01T10-00-00Z")
|
||||
run_dir = tmp_path / "apec" / "runs" / "2026-06-01T10-00-00Z"
|
||||
|
||||
assert paths["run_dir"] == run_dir
|
||||
assert paths["listings"] == run_dir / "listings.yaml"
|
||||
assert paths["run_meta"] == run_dir / "run-meta.yaml"
|
||||
assert paths["snapshots"] == run_dir / "snapshots"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user