test_landing_integrity.py
file-level
1
files
1
commits
0
hotspots
0
🧊 dead
0
💥 blast risk
| 1 | """Data-integrity tests — landing manifest and validator idempotency.""" |
| 2 | |
| 3 | from __future__ import annotations |
| 4 | |
| 5 | from pathlib import Path |
| 6 | |
| 7 | from tools.landing.schema import load_manifest |
| 8 | from tools.landing.validate import validate_landing |
| 9 | |
| 10 | KIT_ROOT = Path(__file__).resolve().parents[2] |
| 11 | |
| 12 | |
| 13 | def test_manifest_section_order_stable() -> None: |
| 14 | path = KIT_ROOT / "docs" / "landing" / "manifest.yaml" |
| 15 | first = load_manifest(path).section_ids |
| 16 | second = load_manifest(path).section_ids |
| 17 | assert first == second |
| 18 | assert first[0] == "hero" |
| 19 | assert first[-1] == "scenarios" |
| 20 | |
| 21 | |
| 22 | def test_validate_idempotent_on_kit_root() -> None: |
| 23 | r1 = validate_landing(KIT_ROOT) |
| 24 | r2 = validate_landing(KIT_ROOT) |
| 25 | assert r1.ok and r2.ok |
| 26 | assert r1.errors == r2.errors == [] |
| 27 | |
| 28 | |
| 29 | def test_persona_badge_count_matches_manifest() -> None: |
| 30 | manifest = load_manifest(KIT_ROOT / "docs" / "landing" / "manifest.yaml") |
| 31 | html = (KIT_ROOT / "docs" / "landing" / "scenarios" / "index.html").read_text( |
| 32 | encoding="utf-8" |
| 33 | ) |
| 34 | for persona_id in manifest.persona_ids: |
| 35 | assert html.count(f'id="persona-{persona_id}"') == 1 |