astrbot_plugin_moviepilot/tests/test_llm_tools.py

26 行
782 B
Python

2026-07-20 22:31:36 +08:00
from pathlib import Path
MAIN_SOURCE = (Path(__file__).parents[1] / "main.py").read_text(encoding="utf-8")
def test_llm_tools_are_registered_with_argument_documentation() -> None:
expected_tools = (
"moviepilot_search_media",
"moviepilot_search_resources",
"moviepilot_list_subscriptions",
"moviepilot_list_downloads",
"moviepilot_request_subscribe",
"moviepilot_request_download",
)
for tool_name in expected_tools:
assert f'name="{tool_name}"' in MAIN_SOURCE
assert MAIN_SOURCE.count("Args:") >= 4
def test_llm_write_operations_use_confirmation_store() -> None:
assert 'operation="subscribe"' in MAIN_SOURCE
assert 'operation="download"' in MAIN_SOURCE
assert "/mp confirm" in MAIN_SOURCE