MCPcopy Create free account
hub / github.com/IBM/mcp-cli / test_exit_on_stop_signal

Method test_exit_on_stop_signal

tests/agents/test_loop.py:43–56  ·  view source on GitHub ↗

Loop exits on '__stop__' message.

(self)

Source from the content-addressed store, hash-verified

41class TestRunAgentLoop:
42 @pytest.mark.asyncio
43 async def test_exit_on_stop_signal(self):
44 """Loop exits on '__stop__' message."""
45 ctx = _make_context()
46 ui = _make_ui()
47 q: asyncio.Queue = asyncio.Queue()
48 done = asyncio.Event()
49
50 await q.put("__stop__")
51
52 with patch("mcp_cli.chat.conversation.ConversationProcessor"):
53 result = await run_agent_loop(ctx, ui, q, done)
54
55 assert done.is_set()
56 assert isinstance(result, str)
57
58 @pytest.mark.asyncio
59 async def test_exit_on_quit(self):

Callers

nothing calls this directly

Calls 3

run_agent_loopFunction · 0.90
_make_contextFunction · 0.70
_make_uiFunction · 0.70

Tested by

no test coverage detected