Test CTPToolResult has expected fields.
()
| 344 | |
| 345 | @pytest.mark.asyncio |
| 346 | async def test_stream_execute_tools_result_fields(): |
| 347 | """Test CTPToolResult has expected fields.""" |
| 348 | manager = MockToolManager() |
| 349 | calls = [CTPToolCall(id="call_1", tool="test_tool", arguments={})] |
| 350 | |
| 351 | results = [] |
| 352 | async for result in stream_execute_tools(manager, calls): |
| 353 | results.append(result) |
| 354 | |
| 355 | result = results[0] |
| 356 | assert result.id == "call_1" |
| 357 | assert result.tool == "test_tool" |
| 358 | assert isinstance(result.start_time, datetime) |
| 359 | assert isinstance(result.end_time, datetime) |
| 360 | assert result.machine # Should have hostname |
| 361 | assert result.pid > 0 # Should have process ID |
| 362 | |
| 363 | |
| 364 | # ---------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected