mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-22 16:25:58 +00:00
test(mcp): isolate resource error breaker state
This commit is contained in:
parent
f26fb901ea
commit
80209e51db
1 changed files with 8 additions and 4 deletions
|
|
@ -239,10 +239,14 @@ class TestErrorPathResourceText:
|
|||
finally:
|
||||
loop.close()
|
||||
|
||||
with mock_patch.dict(mcp_tool._servers, {"test-server": fake_server}), \
|
||||
mock_patch("tools.mcp_tool._run_on_mcp_loop", side_effect=_fake_run_on_mcp_loop):
|
||||
fake_session.call_tool = AsyncMock()
|
||||
yield fake_session, mcp_tool._make_tool_handler("test-server", "my-tool", 30.0)
|
||||
mcp_tool._reset_server_error("test-server")
|
||||
try:
|
||||
with mock_patch.dict(mcp_tool._servers, {"test-server": fake_server}), \
|
||||
mock_patch("tools.mcp_tool._run_on_mcp_loop", side_effect=_fake_run_on_mcp_loop):
|
||||
fake_session.call_tool = AsyncMock()
|
||||
yield fake_session, mcp_tool._make_tool_handler("test-server", "my-tool", 30.0)
|
||||
finally:
|
||||
mcp_tool._reset_server_error("test-server")
|
||||
|
||||
def test_error_embedded_resource_text_surfaced(self, _handler):
|
||||
from unittest.mock import AsyncMock
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue