(self)
| 1192 | |
| 1193 | @pytest.mark.asyncio |
| 1194 | async def test_failed_result(self): |
| 1195 | tm = DummyToolManager() |
| 1196 | ctx = DummyContext(tool_manager=tm) |
| 1197 | ui = DummyUIManager() |
| 1198 | tp = ToolProcessor(ctx, ui) |
| 1199 | |
| 1200 | tp._call_metadata["c1"] = ToolCallMetadata( |
| 1201 | llm_tool_name="echo", |
| 1202 | execution_tool_name="echo", |
| 1203 | display_name="echo", |
| 1204 | arguments={}, |
| 1205 | raw_arguments="{}", |
| 1206 | ) |
| 1207 | |
| 1208 | now = datetime.now(UTC) |
| 1209 | result = CTPToolResult( |
| 1210 | id="c1", |
| 1211 | tool="echo", |
| 1212 | result=None, |
| 1213 | error="Tool failed", |
| 1214 | start_time=now, |
| 1215 | end_time=now, |
| 1216 | machine=platform.node(), |
| 1217 | pid=os.getpid(), |
| 1218 | ) |
| 1219 | await tp._on_tool_result(result) |
| 1220 | |
| 1221 | tool_msgs = [m for m in ctx.conversation_history if m.role.value == "tool"] |
| 1222 | assert any("Error: Tool failed" in m.content for m in tool_msgs) |
| 1223 | |
| 1224 | @pytest.mark.asyncio |
| 1225 | async def test_verbose_mode_display(self): |
nothing calls this directly
no test coverage detected