Skip to content

Commit 2f98f7a

Browse files
version gate version 0 of fastmcp
1 parent f2c7889 commit 2f98f7a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/integrations/fastmcp/test_fastmcp.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,10 @@ async def multiply_numbers(x: int, y: int) -> dict:
397397
"result": 42,
398398
"operation": "multiplication",
399399
}
400+
elif isinstance(mcp, StandaloneFastMCP) and FASTMCP_VERSION.startswith("0"):
401+
assert result.json()["result"]["content"][0]["text"] == json.dumps(
402+
{"result": 42, "operation": "multiplication"},
403+
)
400404
else:
401405
assert result.json()["result"]["content"][0]["text"] == json.dumps(
402406
{"result": 42, "operation": "multiplication"},
@@ -1000,8 +1004,11 @@ def http_tool(data: str) -> dict:
10001004
)
10011005

10021006
if isinstance(mcp, StandaloneFastMCP) and FASTMCP_VERSION.startswith("2"):
1003-
print("structured")
10041007
assert result.json()["result"]["structuredContent"] == {"processed": "TEST"}
1008+
elif isinstance(mcp, StandaloneFastMCP) and FASTMCP_VERSION.startswith("0"):
1009+
assert result.json()["result"]["content"][0]["text"] == json.dumps(
1010+
{"processed": "TEST"},
1011+
)
10051012
else:
10061013
assert result.json()["result"]["content"][0]["text"] == json.dumps(
10071014
{"processed": "TEST"},

0 commit comments

Comments
 (0)