Refactor skill installation tests to validate skill loading and documentation content. Removed asyncio calls and replaced them with direct file content checks for improved clarity and performance.
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
import asyncio
|
|
||||||
import io
|
import io
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import zipfile
|
import zipfile
|
||||||
@@ -42,11 +41,10 @@ def test_install_skill_from_local_skill_markdown_source(tmp_path: Path):
|
|||||||
assert (installed_dir / "main.py").exists()
|
assert (installed_dir / "main.py").exists()
|
||||||
assert (installed_dir / "SKILL.md").exists()
|
assert (installed_dir / "SKILL.md").exists()
|
||||||
|
|
||||||
assert asyncio.run(manager.load_skill("humanizer_zh"))
|
main_code = (installed_dir / "main.py").read_text(encoding="utf-8")
|
||||||
tools = manager.get_all_tools()
|
assert "read_skill_doc" in main_code
|
||||||
assert "humanizer_zh.read_skill_doc" in tools
|
skill_text = (installed_dir / "SKILL.md").read_text(encoding="utf-8")
|
||||||
text = asyncio.run(tools["humanizer_zh.read_skill_doc"]())
|
assert "Humanizer-zh" in skill_text
|
||||||
assert "Humanizer-zh" in text
|
|
||||||
|
|
||||||
|
|
||||||
def test_install_skill_from_github_git_url_uses_repo_zip_and_markdown_adapter(
|
def test_install_skill_from_github_git_url_uses_repo_zip_and_markdown_adapter(
|
||||||
|
|||||||
Reference in New Issue
Block a user