Skip to content

Commit 46cd46e

Browse files
committed
Use inline snapshots for the explicit-title schema test
1 parent e282569 commit 46cd46e

1 file changed

Lines changed: 19 additions & 14 deletions

File tree

‎tests/server/mcpserver/test_tool_manager.py‎

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from typing import Annotated, Any, TypedDict
55

66
import pytest
7+
from inline_snapshot import snapshot
78
from mcp_types import CallToolResult, TextContent, ToolAnnotations
89
from pydantic import BaseModel, Field
910

@@ -915,17 +916,21 @@ def find_book(query: Annotated[str, Field(title="Search query")], limit: int = 1
915916

916917
tool = ToolManager().add_tool(find_book)
917918

918-
assert tool.parameters == {
919-
"type": "object",
920-
"properties": {
921-
"query": {"title": "Search query", "type": "string"},
922-
"limit": {"default": 10, "type": "integer"},
923-
},
924-
"required": ["query"],
925-
}
926-
assert tool.output_schema == {
927-
"type": "object",
928-
"properties": {"name": {"title": "Book title", "type": "string"}, "year": {"type": "integer"}},
929-
"required": ["name", "year"],
930-
"title": "Book",
931-
}
919+
assert tool.parameters == snapshot(
920+
{
921+
"properties": {
922+
"query": {"title": "Search query", "type": "string"},
923+
"limit": {"default": 10, "type": "integer"},
924+
},
925+
"required": ["query"],
926+
"type": "object",
927+
}
928+
)
929+
assert tool.output_schema == snapshot(
930+
{
931+
"properties": {"name": {"title": "Book title", "type": "string"}, "year": {"type": "integer"}},
932+
"required": ["name", "year"],
933+
"title": "Book",
934+
"type": "object",
935+
}
936+
)

0 commit comments

Comments
 (0)