This commit is contained in:
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
|
||||
import time
|
||||
|
||||
from mcp_server.server import handle_request
|
||||
from mcp_server import tools
|
||||
|
||||
MAX_LATENCY_SECONDS = 2
|
||||
|
||||
@@ -12,7 +12,7 @@ MAX_LATENCY_SECONDS = 2
|
||||
def test_list_tools_is_fast() -> None:
|
||||
"""ListTools responds under the latency target."""
|
||||
start = time.perf_counter()
|
||||
handle_request({"method": "listTools", "params": {}})
|
||||
tools.list_tools_payload()
|
||||
duration = time.perf_counter() - start
|
||||
assert duration < MAX_LATENCY_SECONDS
|
||||
|
||||
@@ -20,6 +20,6 @@ def test_list_tools_is_fast() -> None:
|
||||
def test_invoke_tool_is_fast() -> None:
|
||||
"""InvokeTool responds under the latency target."""
|
||||
start = time.perf_counter()
|
||||
handle_request({"method": "invokeTool", "params": {"name": "show-constitution", "args": {}}})
|
||||
tools.invoke_tool("show-constitution", {})
|
||||
duration = time.perf_counter() - start
|
||||
assert duration < MAX_LATENCY_SECONDS
|
||||
|
||||
Reference in New Issue
Block a user