mirror of
https://github.com/aljazceru/mcp-python-sdk.git
synced 2025-12-19 06:54:18 +01:00
fix: Address formatting and type checking issues
This commit is contained in:
@@ -35,7 +35,9 @@ class TestServer:
|
||||
"""Test that FastMCP handles non-ASCII characters in descriptions correctly"""
|
||||
mcp = FastMCP()
|
||||
|
||||
@mcp.tool(description="🌟 This tool uses emojis and UTF-8 characters: á é í ó ú ñ 漢字 🎉")
|
||||
@mcp.tool(
|
||||
description="🌟 This tool uses emojis and UTF-8 characters: á é í ó ú ñ 漢字 🎉"
|
||||
)
|
||||
def hello_world(name: str = "世界") -> str:
|
||||
return f"¡Hola, {name}! 👋"
|
||||
|
||||
@@ -43,6 +45,7 @@ class TestServer:
|
||||
tools = await client.list_tools()
|
||||
assert len(tools.tools) == 1
|
||||
tool = tools.tools[0]
|
||||
assert tool.description is not None
|
||||
assert "🌟" in tool.description
|
||||
assert "漢字" in tool.description
|
||||
assert "🎉" in tool.description
|
||||
|
||||
@@ -18,8 +18,12 @@ from mcp.types import (
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_server_session_initialize():
|
||||
server_to_client_send, server_to_client_receive = anyio.create_memory_object_stream[JSONRPCMessage](1)
|
||||
client_to_server_send, client_to_server_receive = anyio.create_memory_object_stream[JSONRPCMessage](1)
|
||||
server_to_client_send, server_to_client_receive = anyio.create_memory_object_stream[
|
||||
JSONRPCMessage
|
||||
](1)
|
||||
client_to_server_send, client_to_server_receive = anyio.create_memory_object_stream[
|
||||
JSONRPCMessage
|
||||
](1)
|
||||
|
||||
async def run_client(client: ClientSession):
|
||||
async for message in client_session.incoming_messages:
|
||||
|
||||
Reference in New Issue
Block a user