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

Function TEST_F

tests/unit/openai_client_test.cpp:34–47  ·  view source on GitHub ↗

Constructor and Configuration Tests

Source from the content-addressed store, hash-verified

32 std::unique_ptr<ai::openai::OpenAIClient> client_;
33};
34
35// Constructor and Configuration Tests
36TEST_F(OpenAIClientTest, ConstructorWithValidApiKey) {
37 ai::openai::OpenAIClient client("sk-validkey123", "https://api.openai.com");
38
39 EXPECT_TRUE(client.is_valid());
40 EXPECT_EQ(client.provider_name(), "openai");
41 EXPECT_THAT(client.config_info(), testing::HasSubstr("OpenAI API"));
42
43 // Test public interface access only
44 EXPECT_EQ(client.get_api_key(), "sk-validkey123");
45 EXPECT_EQ(client.get_base_url(), "https://api.openai.com");
46 // Commented out internal method tests that don't exist:
47 // EXPECT_EQ(client.get_host(), "api.openai.com");
48 // EXPECT_TRUE(client.get_use_ssl());
49}
50

Callers

nothing calls this directly

Calls 11

StreamOptionsClass · 0.85
GenerateOptionsClass · 0.85
is_validMethod · 0.45
provider_nameMethod · 0.45
config_infoMethod · 0.45
supported_modelsMethod · 0.45
supports_modelMethod · 0.45
generate_textMethod · 0.45
is_successMethod · 0.45
error_messageMethod · 0.45
stream_textMethod · 0.45

Tested by

no test coverage detected