mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-21 21:14:17 +02:00
Update failing tests
This commit is contained in:
parent
b3799e7a73
commit
5520102821
2 changed files with 5 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import json
|
||||
from dataclasses import dataclass
|
||||
from typing import Annotated, Any, TypedDict
|
||||
from typing import Annotated, Any
|
||||
|
||||
import pytest
|
||||
from mcp.types import (
|
||||
|
|
@ -11,6 +11,7 @@ from mcp.types import (
|
|||
TextResourceContents,
|
||||
)
|
||||
from pydantic import AnyUrl, BaseModel, Field, TypeAdapter
|
||||
from typing_extensions import TypedDict
|
||||
|
||||
from fastmcp.tools.tool import Tool, _convert_to_content
|
||||
from fastmcp.utilities.types import Audio, File, Image
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ async def test_forward_raw_without_argument_mapping(add_tool):
|
|||
|
||||
|
||||
async def test_custom_fn_with_kwargs_and_no_transform_args(add_tool):
|
||||
async def custom_fn(extra: int, **kwargs) -> ToolResult:
|
||||
async def custom_fn(extra: int, **kwargs) -> int:
|
||||
sum = await forward(**kwargs)
|
||||
return int(sum.content[0].text) + extra # type: ignore[attr-defined]
|
||||
|
||||
|
|
@ -1216,10 +1216,10 @@ class TestTransformToolOutputSchema:
|
|||
):
|
||||
"""Test transformation handling of mixed content types."""
|
||||
|
||||
async def custom_fn(x: int) -> ToolResult:
|
||||
async def custom_fn(x: int):
|
||||
# Return mixed content including ToolResult
|
||||
if x == 1:
|
||||
return ["text", {"data": x}] # type: ignore[return-value]
|
||||
return ["text", {"data": x}]
|
||||
else:
|
||||
# Return ToolResult directly
|
||||
return ToolResult(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue