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

Method test_to_dict

tests/chat/test_streaming_handler.py:69–85  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

67 assert sr.streaming is False
68
69 def test_to_dict(self):
70 sr = StreamingResponse(
71 content="abc",
72 tool_calls=[],
73 chunks_received=3,
74 elapsed_time=0.5,
75 interrupted=False,
76 reasoning_content=None,
77 )
78 d = sr.to_dict()
79 assert d[StreamingResponseField.RESPONSE] == "abc"
80 assert d[StreamingResponseField.TOOL_CALLS] == []
81 assert d[StreamingResponseField.CHUNKS_RECEIVED] == 3
82 assert d[StreamingResponseField.ELAPSED_TIME] == 0.5
83 assert d[StreamingResponseField.STREAMING] is True
84 assert d[StreamingResponseField.INTERRUPTED] is False
85 assert d[StreamingResponseField.REASONING_CONTENT] is None
86
87 def test_to_dict_with_tool_calls(self):
88 tc = {

Callers

nothing calls this directly

Calls 2

to_dictMethod · 0.95
StreamingResponseClass · 0.90

Tested by

no test coverage detected