Mock Stream Implementation Tests
| 92 | EXPECT_THAT(error_data, testing::HasSubstr("Stream error")); |
| 93 | } |
| 94 | |
| 95 | TEST_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()); |
nothing calls this directly
no outgoing calls
no test coverage detected