MCPcopy Index your code
hub / github.com/modelcontextprotocol/python-sdk / test_read_resource

Function test_read_resource

tests/client/test_client.py:184–192  ·  view source on GitHub ↗

Test reading a resource.

(app: MCPServer)

Source from the content-addressed store, hash-verified

182
183
184async def test_read_resource(app: MCPServer):
185 """Test reading a resource."""
186 async with Client(app) as client:
187 result = await client.read_resource("test://resource")
188 assert result == snapshot(
189 ReadResourceResult(
190 contents=[TextResourceContents(uri="test://resource", mime_type="text/plain", text="Test content")]
191 )
192 )
193
194
195async def test_read_resource_error_propagates():

Callers

nothing calls this directly

Calls 4

ClientClass · 0.90
ReadResourceResultClass · 0.90
read_resourceMethod · 0.45

Tested by

no test coverage detected