mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-07-12 16:02:35 +08:00
feat: unify download task tool names
This commit is contained in:
27
tests/test_agent_download_task_tool_names.py
Normal file
27
tests/test_agent_download_task_tool_names.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from unittest.mock import patch
|
||||
|
||||
from app.agent.tools.factory import MoviePilotToolFactory
|
||||
|
||||
|
||||
def test_factory_registers_plural_download_task_tool_names():
|
||||
"""
|
||||
下载任务工具应统一使用 *_download_tasks 命名。
|
||||
"""
|
||||
with patch(
|
||||
"app.agent.tools.factory.PluginManager.get_plugin_agent_tools",
|
||||
return_value=[],
|
||||
):
|
||||
tools = MoviePilotToolFactory.create_tools(
|
||||
session_id="download-task-names",
|
||||
user_id="10001",
|
||||
)
|
||||
|
||||
tool_names = {tool.name for tool in tools}
|
||||
assert {
|
||||
"add_download_tasks",
|
||||
"query_download_tasks",
|
||||
"update_download_tasks",
|
||||
"delete_download_tasks",
|
||||
} <= tool_names
|
||||
assert "add_download" not in tool_names
|
||||
assert "delete_download" not in tool_names
|
||||
Reference in New Issue
Block a user