Jeremiah Lowin commited on
Commit
f4bfd8f
·
1 Parent(s): 07fd455

Update test_server_interactions.py

Browse files
tests/server/test_server_interactions.py CHANGED
@@ -6,6 +6,7 @@ from enum import Enum
6
  from pathlib import Path
7
  from typing import Annotated, Literal
8
 
 
9
  import pytest
10
  from mcp.types import (
11
  BlobResourceContents,
@@ -144,7 +145,7 @@ class TestToolReturnTypes:
144
  async with Client(mcp) as client:
145
  result = await client.call_tool("uuid_tool", {})
146
  assert isinstance(result[0], TextContent)
147
- assert result[0].text == f'"{test_uuid}"'
148
 
149
  async def test_path(self):
150
  mcp = FastMCP()
@@ -158,7 +159,7 @@ class TestToolReturnTypes:
158
  async with Client(mcp) as client:
159
  result = await client.call_tool("path_tool", {})
160
  assert isinstance(result[0], TextContent)
161
- assert result[0].text == f'"{str(test_path)}"'
162
 
163
  async def test_datetime(self):
164
  mcp = FastMCP()
@@ -172,7 +173,7 @@ class TestToolReturnTypes:
172
  async with Client(mcp) as client:
173
  result = await client.call_tool("datetime_tool", {})
174
  assert isinstance(result[0], TextContent)
175
- assert result[0].text == f'"{dt.isoformat()}"'
176
 
177
  async def test_image(self, tmp_path: Path):
178
  mcp = FastMCP()
 
6
  from pathlib import Path
7
  from typing import Annotated, Literal
8
 
9
+ import pydantic_core
10
  import pytest
11
  from mcp.types import (
12
  BlobResourceContents,
 
145
  async with Client(mcp) as client:
146
  result = await client.call_tool("uuid_tool", {})
147
  assert isinstance(result[0], TextContent)
148
+ assert result[0].text == pydantic_core.to_json(test_uuid).decode()
149
 
150
  async def test_path(self):
151
  mcp = FastMCP()
 
159
  async with Client(mcp) as client:
160
  result = await client.call_tool("path_tool", {})
161
  assert isinstance(result[0], TextContent)
162
+ assert result[0].text == pydantic_core.to_json(test_path).decode()
163
 
164
  async def test_datetime(self):
165
  mcp = FastMCP()
 
173
  async with Client(mcp) as client:
174
  result = await client.call_tool("datetime_tool", {})
175
  assert isinstance(result[0], TextContent)
176
+ assert result[0].text == pydantic_core.to_json(dt).decode()
177
 
178
  async def test_image(self, tmp_path: Path):
179
  mcp = FastMCP()