This commit is contained in:
parent
3a6f2996cd
commit
837ef904f8
1 changed files with 1757 additions and 567 deletions
|
|
@ -10,6 +10,7 @@ from mcp_types import CallToolResult, TextContent
|
|||
|
||||
from docs_src.testing.tutorial001 import mcp
|
||||
from mcp import Client
|
||||
from tests.docs_src._helpers import strip_server_info
|
||||
|
||||
# See test_index.py for why this is a per-module mark and not a conftest hook.
|
||||
pytestmark = [pytest.mark.anyio, pytest.mark.filterwarnings("error::mcp.MCPDeprecationWarning")]
|
||||
|
|
@ -18,6 +19,7 @@ pytestmark = [pytest.mark.anyio, pytest.mark.filterwarnings("error::mcp.MCPDepre
|
|||
async def test_call_add_tool() -> None:
|
||||
async with Client(mcp, raise_exceptions=True) as client:
|
||||
result = await client.call_tool("add", {"a": 1, "b": 2})
|
||||
result = strip_server_info(result, mcp)
|
||||
assert result == snapshot(
|
||||
CallToolResult(content=[TextContent(type="text", text="3")], structured_content={"result": 3})
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue