refactor: McpError renamed to MCPError and flatten parameters (#1956)
Co-authored-by: Max Isbey <224885523+maxisbey@users.noreply.github.com>
This commit is contained in:
parent
65c614e48e
commit
acba5478a9
1 changed files with 253 additions and 326 deletions
|
|
@ -3,7 +3,7 @@
|
|||
import pytest
|
||||
|
||||
from mcp.server.experimental.request_context import Experimental
|
||||
from mcp.shared.exceptions import McpError
|
||||
from mcp.shared.exceptions import MCPError
|
||||
from mcp.types import (
|
||||
METHOD_NOT_FOUND,
|
||||
TASK_FORBIDDEN,
|
||||
|
|
@ -58,7 +58,7 @@ def test_validate_task_mode_required_without_task_returns_error() -> None:
|
|||
|
||||
def test_validate_task_mode_required_without_task_raises_by_default() -> None:
|
||||
exp = Experimental(task_metadata=None)
|
||||
with pytest.raises(McpError) as exc_info:
|
||||
with pytest.raises(MCPError) as exc_info:
|
||||
exp.validate_task_mode(TASK_REQUIRED)
|
||||
assert exc_info.value.error.code == METHOD_NOT_FOUND
|
||||
|
||||
|
|
@ -79,7 +79,7 @@ def test_validate_task_mode_forbidden_with_task_returns_error() -> None:
|
|||
|
||||
def test_validate_task_mode_forbidden_with_task_raises_by_default() -> None:
|
||||
exp = Experimental(task_metadata=TaskMetadata(ttl=60000))
|
||||
with pytest.raises(McpError) as exc_info:
|
||||
with pytest.raises(MCPError) as exc_info:
|
||||
exp.validate_task_mode(TASK_FORBIDDEN)
|
||||
assert exc_info.value.error.code == METHOD_NOT_FOUND
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue