Files
playbook/tests/test_superpowers_list_sync.py
T
csh 94395056ea 🐛 fix(playbook): address reported repo issues
normalize Windows path-like TOML config values, regenerate .agents/index.md on sync, keep the SKILLS.md superpowers section route-only, and ignore generated Python cache dirs.

add regression coverage for load_config() and the standards sync behavior touched by these fixes.
2026-03-10 10:10:28 +08:00

36 lines
1.0 KiB
Python

import unittest
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
SKILLS_MD = ROOT / "SKILLS.md"
SOURCES_LIST = ROOT / "codex" / "skills" / ".sources" / "superpowers.list"
SOURCE_REF = "来源:`codex/skills/.sources/superpowers.list`(第三方来源清单)。"
def read_sources_list() -> list[str]:
return [
line.strip()
for line in SOURCES_LIST.read_text(encoding="utf-8").splitlines()
if line.strip() and not line.strip().startswith("#")
]
def read_skills_md() -> str:
return SKILLS_MD.read_text(encoding="utf-8")
class SuperpowersListSyncTests(unittest.TestCase):
def test_superpowers_section_routes_to_source_list(self):
self.assertTrue(read_sources_list())
text = read_skills_md()
self.assertIn(SOURCE_REF, text)
self.assertEqual(text.count("Third-party Skills (superpowers)"), 1)
self.assertNotIn("<!-- superpowers:skills:start -->", text)
self.assertNotIn("<!-- superpowers:skills:end -->", text)
if __name__ == "__main__":
unittest.main()