"""Story 5.3 — README mandatory sections, changelog, version consistency.""" from __future__ import annotations import json import pathlib ROOT = pathlib.Path(__file__).parent.parent def test_readme_has_mandatory_sections() -> None: text = (ROOT / "README.md").read_text(encoding="utf-8") low = text.lower() # privacy in both languages (FR-6.5) + at-rest/backup caveat (FR-6.4) assert "## privacy" in low and "## datenschutz" in low assert "backup" in low and ("unencrypted" in low or "unverschlüsselt" in low) # LLM residual risk (AD-16) assert "residual risk" in low or "restrisiko" in low # inventory delete warning (FR-2.4) assert "removing the integration deletes your wardrobe" in low # YAML-mode manual step (AD-12) assert "yaml-mode" in low and "/what_to_wear/what-to-wear-card.js" in text # blueprint import badges (FR-7.4) assert "blueprint_import" in text # custom repository install path (S-3 interim) assert "custom repositor" in low def test_changelog_and_version_consistent() -> None: changelog = (ROOT / "CHANGELOG.md").read_text(encoding="utf-8") assert "1.0.0" in changelog manifest = json.loads( (ROOT / "custom_components" / "what_to_wear" / "manifest.json").read_text(encoding="utf-8") ) assert manifest["version"] == "1.0.0" def test_beta_protocol_present() -> None: protocol = (ROOT / "docs" / "beta" / "PROTOCOL.md").read_text(encoding="utf-8") assert "15" in protocol and "S-2" in protocol # the <15min timing metric