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

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