test(tsl_syntax): enforce lookup packaging contracts

This commit is contained in:
csh
2026-07-13 09:16:54 +08:00
parent 617275e92d
commit 9b9e0dfcb7
3 changed files with 37 additions and 20 deletions
+18 -5
View File
@@ -33,6 +33,10 @@ class BuildTslPlaybookTests(unittest.TestCase):
self.assertFalse((output / "docs" / "index.md").exists())
self.assertTrue((output / "docs" / "tsl" / "index.md").is_file())
syntax_skill = output / "skills" / "tsl-syntax-reference"
self.assertTrue((syntax_skill / "SKILL.md").is_file())
self.assertTrue((syntax_skill / "scripts" / "lookup.py").is_file())
self.assertFalse((syntax_skill / "references" / "index.md").exists())
self.assertTrue(
(output / "skills" / "tsl-api-reference" / "SKILL.md").is_file()
)
@@ -48,7 +52,7 @@ class BuildTslPlaybookTests(unittest.TestCase):
agents_text = (output / "AGENTS.md").read_text(encoding="utf-8")
self.assertIn("# TSL Agent Instructions", agents_text)
self.assertIn("docs/tsl/index.md", agents_text)
self.assertIn("tsl-syntax-reference", agents_text)
self.assertIn("tsl-api-reference", agents_text)
self.assertNotIn(".agents/index.md", agents_text)
self.assertNotIn(".agents/tsl/index.md", agents_text)
@@ -201,12 +205,21 @@ def copy_required_sources(repo: Path) -> None:
"# TSL Index\n", encoding="utf-8", newline="\n"
)
skill = repo / "skills" / "tsl-api-reference"
(skill / "scripts").mkdir(parents=True)
(skill / "SKILL.md").write_text(
syntax_skill = repo / "skills" / "tsl-syntax-reference"
(syntax_skill / "scripts").mkdir(parents=True)
(syntax_skill / "SKILL.md").write_text(
"---\nname: tsl-syntax-reference\n---\n", encoding="utf-8", newline="\n"
)
(syntax_skill / "scripts" / "lookup.py").write_text(
"print('lookup')\n", encoding="utf-8", newline="\n"
)
api_skill = repo / "skills" / "tsl-api-reference"
(api_skill / "scripts").mkdir(parents=True)
(api_skill / "SKILL.md").write_text(
"---\nname: tsl-api-reference\n---\n", encoding="utf-8", newline="\n"
)
(skill / "scripts" / "lookup.py").write_text(
(api_skill / "scripts" / "lookup.py").write_text(
"print('lookup')\n", encoding="utf-8", newline="\n"
)