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

Method test_with_tool_calls

tests/chat/test_models.py:219–229  ·  view source on GitHub ↗

Test creating message with typed tool calls.

(self)

Source from the content-addressed store, hash-verified

217 assert typed == []
218
219 def test_with_tool_calls(self):
220 """Test creating message with typed tool calls."""
221 fc = FunctionCallData(name="sqrt", arguments='{"x": 18}')
222 tc = ToolCallData(id="call_1", function=fc)
223
224 msg = Message.with_tool_calls(
225 role=MessageRole.ASSISTANT, tool_calls=[tc], content="Calling sqrt"
226 )
227 assert msg.role == MessageRole.ASSISTANT
228 assert msg.content == "Calling sqrt"
229 assert len(msg.tool_calls) == 1
230
231
232class TestToolExecutionRecord:

Callers

nothing calls this directly

Calls 3

FunctionCallDataClass · 0.90
ToolCallDataClass · 0.90
with_tool_callsMethod · 0.80

Tested by

no test coverage detected