MCPcopy Index your code
hub / github.com/MiniMax-AI/Mini-Agent / test_script_path_processing

Function test_script_path_processing

tests/test_skill_loader.py:219–246  ·  view source on GitHub ↗

Test processing of script paths in skills

()

Source from the content-addressed store, hash-verified

217
218
219def 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 = """---
232name: test-skill
233description: Test skill with scripts
234---
235
236Run 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
249def test_skill_to_prompt_includes_root_directory():

Callers

nothing calls this directly

Calls 2

load_skillMethod · 0.95
SkillLoaderClass · 0.90

Tested by

no test coverage detected