Files
CraftKit/migration/tests/test_public_baseline_batch.py
T

40 lines
1.4 KiB
Python

"""公开基线与专项设计 Skill 测试。"""
from pathlib import Path
import unittest
ROOT = Path(__file__).resolve().parents[2]
SKILLS = ROOT / "plugins" / "dev" / "skills"
NAMES = (
"design-api", "design-db", "review-java", "review-frontend",
"design-frontend-data", "review-mybatis", "design-workflow",
)
class PublicBaselineBatchTest(unittest.TestCase):
"""验证公开来源登记和版本边界。"""
def test_sources_are_official_and_dated(self) -> None:
for name in NAMES:
source = (SKILLS / name / "references" / "sources.md").read_text(encoding="utf-8")
self.assertIn("重建日期:2026-08-25", source)
self.assertIn("https://", source)
def test_project_version_is_not_replaced_by_latest(self) -> None:
content = "\n".join(
(SKILLS / name / "SKILL.md").read_text(encoding="utf-8") for name in NAMES
)
self.assertIn("不得默认最新", content)
self.assertIn("规则混用", content)
self.assertIn("精确版本", content)
def test_workflow_does_not_embed_approval_rules(self) -> None:
content = (SKILLS / "design-workflow" / "SKILL.md").read_text(encoding="utf-8")
self.assertIn("不内置审批节点", content)
self.assertIn("项目实际流程引擎", content)
if __name__ == "__main__":
unittest.main()