Spaces:
Running
Running
Jeremiah Lowin commited on
Commit ·
dfd1df8
1
Parent(s): 0ce024d
Improve datetime test to avoid now
Browse files
tests/server/test_server_interactions.py
CHANGED
|
@@ -522,12 +522,12 @@ class TestToolParameters:
|
|
| 522 |
def send_datetime(x: datetime.datetime) -> str:
|
| 523 |
return x.isoformat()
|
| 524 |
|
|
|
|
|
|
|
| 525 |
async with Client(mcp) as client:
|
| 526 |
-
result = await client.call_tool(
|
| 527 |
-
"send_datetime", {"x": datetime.datetime.now()}
|
| 528 |
-
)
|
| 529 |
assert isinstance(result[0], TextContent)
|
| 530 |
-
assert result[0].text ==
|
| 531 |
|
| 532 |
async def test_datetime_type_parse_string(self):
|
| 533 |
mcp = FastMCP()
|
|
|
|
| 522 |
def send_datetime(x: datetime.datetime) -> str:
|
| 523 |
return x.isoformat()
|
| 524 |
|
| 525 |
+
dt = datetime.datetime(2025, 4, 25, 1, 2, 3)
|
| 526 |
+
|
| 527 |
async with Client(mcp) as client:
|
| 528 |
+
result = await client.call_tool("send_datetime", {"x": dt})
|
|
|
|
|
|
|
| 529 |
assert isinstance(result[0], TextContent)
|
| 530 |
+
assert result[0].text == dt.isoformat()
|
| 531 |
|
| 532 |
async def test_datetime_type_parse_string(self):
|
| 533 |
mcp = FastMCP()
|