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

Class MockHTTPClient

tests/utils/mock_openai_client.h:17–32  ·  view source on GitHub ↗

Mock HTTP client for testing network interactions

Source from the content-addressed store, hash-verified

15
16// Mock HTTP client for testing network interactions
17class MockHTTPClient {
18 public:
19 // Using simple function signatures to avoid GMock template issues
20 virtual ~MockHTTPClient() = default;
21 virtual bool post(const std::string& url,
22 const std::map<std::string, std::string>& headers,
23 const std::string& body,
24 std::string& response_body,
25 int& status_code) = 0;
26
27 virtual bool stream_post(
28 const std::string& url,
29 const std::map<std::string, std::string>& headers,
30 const std::string& body,
31 const std::function<void(const std::string&)>& callback) = 0;
32};
33
34// Controllable OpenAI client for testing
35class ControllableOpenAIClient {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected