test_landing_integrity.py python
35 lines 1.1 KB
Raw
sha256:c07f2f34a0db9f43fe866f157d1935322008545ff8940c06c7c921eb219c55ab NXP-b DONE: independent BV-r2 pass + ISR (SD-17) Human minor ⚠ breaking 1 day ago
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
File History 1 commit
sha256:c07f2f34a0db9f43fe866f157d1935322008545ff8940c06c7c921eb219c55ab NXP-b DONE: independent BV-r2 pass + ISR (SD-17) Human minor 1 day ago