test: capture commercial astrology e2e contexts

This commit is contained in:
732642856
2026-07-19 17:28:15 +08:00
parent 02eccede4a
commit 75c4c4c82e
16 changed files with 161866 additions and 0 deletions
@@ -0,0 +1,26 @@
from __future__ import annotations
import json
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
SCRIPTS = ROOT / "scripts"
if str(SCRIPTS) not in sys.path:
sys.path.insert(0, str(SCRIPTS))
import capture_commercial_astrology_e2e_contexts as capture_script # noqa: E402
def test_capture_writes_runtime_contexts_without_required_layer_echo(tmp_path: Path) -> None:
manifest = capture_script.capture(output_dir=tmp_path)
assert manifest["question_count"] == 10
assert (tmp_path / "capture_manifest.json").exists()
for row in manifest["rows"]:
context_path = ROOT / row["context_file"] if not Path(row["context_file"]).is_absolute() else Path(row["context_file"])
data = json.loads(context_path.read_text(encoding="utf-8"))
assert data["success"] is True
assert "consumer_context" in data
assert "required_layers" not in data