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

Function TEST_F

tests/unit/anthropic_client_test.cpp:34–48  ·  view source on GitHub ↗

Constructor and Configuration Tests

Source from the content-addressed store, hash-verified

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