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

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