mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-23 14:04:18 +02:00
Merge pull request #2992 from jlowin/pydocket-github-validation
Bump pydocket to 0.17.2 (memory leak fix)
This commit is contained in:
commit
7d32409505
3 changed files with 458 additions and 549 deletions
|
|
@ -10,7 +10,7 @@ dependencies = [
|
|||
"mcp>=1.24.0,<2.0",
|
||||
"openapi-pydantic>=0.5.1",
|
||||
"platformdirs>=4.0.0",
|
||||
"pydocket>=0.16.6,<0.17.0",
|
||||
"pydocket>=0.17.2",
|
||||
"rich>=13.9.4",
|
||||
"cyclopts>=4.0.0",
|
||||
"authlib>=1.6.5",
|
||||
|
|
@ -103,7 +103,6 @@ style = "pep440"
|
|||
bump = true
|
||||
fallback-version = "0.0.0"
|
||||
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
asyncio_mode = "auto"
|
||||
# filterwarnings = ["error::DeprecationWarning"]
|
||||
|
|
|
|||
|
|
@ -477,6 +477,8 @@ class TestResourceToolMiddleware:
|
|||
|
||||
async def test_read_resource_tool_works(self, server_with_resources: FastMCP):
|
||||
"""Test that the read_resource tool can be called."""
|
||||
import json
|
||||
|
||||
middleware = ResourceToolMiddleware()
|
||||
server_with_resources.add_middleware(middleware)
|
||||
|
||||
|
|
@ -485,14 +487,18 @@ class TestResourceToolMiddleware:
|
|||
name="read_resource", arguments={"uri": "file://config.txt"}
|
||||
)
|
||||
|
||||
assert result.content == snapshot(
|
||||
[
|
||||
TextContent(
|
||||
type="text",
|
||||
text='[{"content":"debug=true","mime_type":"text/plain"}]',
|
||||
)
|
||||
]
|
||||
)
|
||||
assert result.structured_content == snapshot(
|
||||
{"result": [{"content": "debug=true", "mime_type": "text/plain"}]}
|
||||
)
|
||||
# Parse the JSON text content to check the actual values
|
||||
# (MCP 1.26+ includes "meta":null in serialization, earlier versions don't)
|
||||
assert len(result.content) == 1
|
||||
assert result.content[0].type == "text"
|
||||
parsed = json.loads(result.content[0].text) # type: ignore[attr-defined]
|
||||
assert len(parsed) == 1
|
||||
assert parsed[0]["content"] == "debug=true"
|
||||
assert parsed[0]["mime_type"] == "text/plain"
|
||||
|
||||
# Check structured content similarly
|
||||
assert result.structured_content is not None
|
||||
assert "result" in result.structured_content
|
||||
assert len(result.structured_content["result"]) == 1
|
||||
assert result.structured_content["result"][0]["content"] == "debug=true"
|
||||
assert result.structured_content["result"][0]["mime_type"] == "text/plain"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue