Return -32602 for resource not found (SEP-2164) (#2920)
This commit is contained in:
parent
0fa03ec69f
commit
f253682393
1 changed files with 113 additions and 43 deletions
|
|
@ -6,6 +6,7 @@ import pytest
|
|||
from pydantic import BaseModel
|
||||
|
||||
from mcp.server.mcpserver import Context, MCPServer
|
||||
from mcp.server.mcpserver.exceptions import ResourceError
|
||||
from mcp.server.mcpserver.resources import FunctionResource, ResourceTemplate
|
||||
from mcp.types import Annotations
|
||||
|
||||
|
|
@ -87,7 +88,7 @@ class TestResourceTemplate:
|
|||
name="fail",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match="Error creating resource from template"):
|
||||
with pytest.raises(ResourceError, match="Error creating resource from template"):
|
||||
await template.create_resource("fail://test", {"x": "test"}, Context())
|
||||
|
||||
@pytest.mark.anyio
|
||||
|
|
|
|||
Loading…
Reference in a new issue