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

Method test_from_dict

tests/chat/test_models.py:106–119  ·  view source on GitHub ↗

Test creating from dict.

(self)

Source from the content-addressed store, hash-verified

104 assert d["function"]["name"] == "sqrt"
105
106 def test_from_dict(self):
107 """Test creating from dict."""
108 data = {
109 "id": "call_123",
110 "type": "function",
111 "index": 0,
112 "function": {
113 "name": "sqrt",
114 "arguments": '{"x": 18}',
115 },
116 }
117 tc = ToolCallData.from_dict(data)
118 assert tc.id == "call_123"
119 assert tc.function.name == "sqrt"
120
121 def test_from_dict_defaults(self):
122 """Test from_dict with missing fields."""

Callers

nothing calls this directly

Calls 1

from_dictMethod · 0.45

Tested by

no test coverage detected