mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-19 20:14:17 +02:00
Update test_server_interactions.py
This commit is contained in:
parent
e439f616c1
commit
d544bc9b60
1 changed files with 4 additions and 3 deletions
|
|
@ -6,6 +6,7 @@ from enum import Enum
|
|||
from pathlib import Path
|
||||
from typing import Annotated, Literal
|
||||
|
||||
import pydantic_core
|
||||
import pytest
|
||||
from mcp.types import (
|
||||
BlobResourceContents,
|
||||
|
|
@ -144,7 +145,7 @@ class TestToolReturnTypes:
|
|||
async with Client(mcp) as client:
|
||||
result = await client.call_tool("uuid_tool", {})
|
||||
assert isinstance(result[0], TextContent)
|
||||
assert result[0].text == f'"{test_uuid}"'
|
||||
assert result[0].text == pydantic_core.to_json(test_uuid).decode()
|
||||
|
||||
async def test_path(self):
|
||||
mcp = FastMCP()
|
||||
|
|
@ -158,7 +159,7 @@ class TestToolReturnTypes:
|
|||
async with Client(mcp) as client:
|
||||
result = await client.call_tool("path_tool", {})
|
||||
assert isinstance(result[0], TextContent)
|
||||
assert result[0].text == f'"{str(test_path)}"'
|
||||
assert result[0].text == pydantic_core.to_json(test_path).decode()
|
||||
|
||||
async def test_datetime(self):
|
||||
mcp = FastMCP()
|
||||
|
|
@ -172,7 +173,7 @@ class TestToolReturnTypes:
|
|||
async with Client(mcp) as client:
|
||||
result = await client.call_tool("datetime_tool", {})
|
||||
assert isinstance(result[0], TextContent)
|
||||
assert result[0].text == f'"{dt.isoformat()}"'
|
||||
assert result[0].text == pydantic_core.to_json(dt).decode()
|
||||
|
||||
async def test_image(self, tmp_path: Path):
|
||||
mcp = FastMCP()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue