MCPcopy
hub / github.com/modelcontextprotocol/python-sdk / test_simple_echo

Function test_simple_echo

tests/test_examples.py:19–27  ·  view source on GitHub ↗

Test the simple echo server

()

Source from the content-addressed store, hash-verified

17
18@pytest.mark.anyio
19async def test_simple_echo():
20 """Test the simple echo server"""
21 from examples.mcpserver.simple_echo import mcp
22
23 async with Client(mcp) as client:
24 result = await client.call_tool("echo", {"text": "hello"})
25 assert result == snapshot(
26 CallToolResult(content=[TextContent(text="hello")], structured_content={"result": "hello"})
27 )
28
29
30@pytest.mark.anyio

Callers

nothing calls this directly

Calls 4

ClientClass · 0.90
CallToolResultClass · 0.90
TextContentClass · 0.90
call_toolMethod · 0.45

Tested by

no test coverage detected