|
3 | 3 | import pytest |
4 | 4 |
|
5 | 5 | from astrbot.core import sp |
6 | | -from astrbot.core.provider.func_tool_manager import FunctionToolManager |
| 6 | +from astrbot.core.provider.func_tool_manager import ( |
| 7 | + FunctionToolManager, |
| 8 | + _modelscope_mcp_transport_from_url_info, |
| 9 | +) |
7 | 10 | from astrbot.core.tools.computer_tools.shell import ExecuteShellTool |
8 | 11 | from astrbot.core.tools.message_tools import SendMessageToUserTool |
9 | 12 | from astrbot.core.tools.web_search_tools import ( |
@@ -293,6 +296,20 @@ def test_is_self_detached_command_handles_quotes_and_comments(command, expected) |
293 | 296 | assert _is_self_detached_command(command) is expected |
294 | 297 |
|
295 | 298 |
|
| 299 | +@pytest.mark.parametrize( |
| 300 | + ("url_info", "expected"), |
| 301 | + [ |
| 302 | + ({"transport": "Streamable HTTP", "url": "https://example.com/mcp"}, "streamable_http"), |
| 303 | + ({"transport_type": "sse", "url": "https://example.com/mcp"}, "sse"), |
| 304 | + ({"type": "streamable_http", "url": "https://example.com/mcp"}, "streamable_http"), |
| 305 | + ({"url": "https://example.com/mcp/sse"}, "sse"), |
| 306 | + ({"url": "https://example.com/mcp"}, "streamable_http"), |
| 307 | + ], |
| 308 | +) |
| 309 | +def test_modelscope_mcp_transport_from_url_info(url_info, expected): |
| 310 | + assert _modelscope_mcp_transport_from_url_info(url_info) == expected |
| 311 | + |
| 312 | + |
296 | 313 | @pytest.mark.asyncio |
297 | 314 | async def test_execute_shell_reports_blank_exception_type(monkeypatch): |
298 | 315 | from astrbot.core.tools.computer_tools import shell as shell_tools |
|
0 commit comments