Test processing of script paths in skills
()
| 217 | |
| 218 | |
| 219 | def test_script_path_processing(): |
| 220 | """Test processing of script paths in skills""" |
| 221 | with tempfile.TemporaryDirectory() as tmpdir: |
| 222 | skill_dir = Path(tmpdir) / "test-skill" |
| 223 | skill_dir.mkdir() |
| 224 | |
| 225 | # Create scripts directory |
| 226 | scripts_dir = skill_dir / "scripts" |
| 227 | scripts_dir.mkdir() |
| 228 | (scripts_dir / "test_script.py").write_text("# Python script", encoding="utf-8") |
| 229 | |
| 230 | # Create SKILL.md with script reference |
| 231 | skill_content = """--- |
| 232 | name: test-skill |
| 233 | description: Test skill with scripts |
| 234 | --- |
| 235 | |
| 236 | Run the script: python scripts/test_script.py |
| 237 | """ |
| 238 | (skill_dir / "SKILL.md").write_text(skill_content, encoding="utf-8") |
| 239 | |
| 240 | loader = SkillLoader(tmpdir) |
| 241 | skill = loader.load_skill(skill_dir / "SKILL.md") |
| 242 | |
| 243 | assert skill is not None |
| 244 | |
| 245 | # Check that script path is converted to absolute |
| 246 | assert str(skill_dir / "scripts" / "test_script.py") in skill.content |
| 247 | |
| 248 | |
| 249 | def test_skill_to_prompt_includes_root_directory(): |
nothing calls this directly
no test coverage detected