MCPcopy Create free account
hub / github.com/ClickHouse/ai-sdk-cpp / MockStreamImpl

Class MockStreamImpl

tests/unit/openai_stream_test.cpp:94–101  ·  view source on GitHub ↗

Mock Stream Implementation Tests

Source from the content-addressed store, hash-verified

92 EXPECT_THAT(error_data, testing::HasSubstr("Stream error"));
93}
94
95TEST_F(StreamEventTest, ParsesFragmentedToolCall) {
96 openai::OpenAIStreamImpl stream;
97 stream.process_sse_line_for_testing(
98 R"(data: {"choices":[{"delta":{"tool_calls":[{"index":0,"id":"call_123","type":"function","function":{"name":"get_weather","arguments":"{\"loc"}}]}}]})");
99 stream.process_sse_line_for_testing(
100 R"(data: {"choices":[{"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ation\":\"Chicago\"}"}}]},"finish_reason":"tool_calls"}]})");
101 stream.process_sse_line_for_testing("data: [DONE]");
102
103 auto tool_event = stream.get_next_event();
104 ASSERT_TRUE(tool_event.is_tool_call());

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected