Loop wires dashboard bridge input queue and broadcasts messages.
(self)
| 201 | |
| 202 | @pytest.mark.asyncio |
| 203 | async def test_dashboard_bridge_wired(self): |
| 204 | """Loop wires dashboard bridge input queue and broadcasts messages.""" |
| 205 | ctx = _make_context() |
| 206 | bridge = MagicMock() |
| 207 | bridge.set_input_queue = MagicMock() |
| 208 | bridge.on_message = AsyncMock() |
| 209 | ctx.dashboard_bridge = bridge |
| 210 | |
| 211 | ui = _make_ui() |
| 212 | q: asyncio.Queue = asyncio.Queue() |
| 213 | done = asyncio.Event() |
| 214 | |
| 215 | await q.put("hello") |
| 216 | await q.put("exit") |
| 217 | |
| 218 | mock_convo = MagicMock() |
| 219 | mock_convo.process_conversation = AsyncMock() |
| 220 | |
| 221 | with patch( |
| 222 | "mcp_cli.chat.conversation.ConversationProcessor", |
| 223 | return_value=mock_convo, |
| 224 | ): |
| 225 | await run_agent_loop(ctx, ui, q, done) |
| 226 | |
| 227 | bridge.set_input_queue.assert_called_once_with(q) |
| 228 | bridge.on_message.assert_called_once_with("user", "hello") |
| 229 | |
| 230 | @pytest.mark.asyncio |
| 231 | async def test_max_response_length_truncated(self): |
nothing calls this directly
no test coverage detected