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

Function TEST_F

tests/integration/openai_integration_test.cpp:42–58  ·  view source on GitHub ↗

Basic API Connectivity Tests

Source from the content-addressed store, hash-verified

40
41// Basic API Connectivity Tests
42TEST_F(OpenAIIntegrationTest, BasicTextGeneration) {
43 if (!use_real_api_) {
44 GTEST_SKIP() << "No OPENAI_API_KEY environment variable set";
45 }
46
47 GenerateOptions options(ai::openai::models::kGpt4oMini,
48 "Hello, how are you?");
49 auto result = client_->generate_text(options);
50
51 TestAssertions::assertSuccess(result);
52 EXPECT_FALSE(result.text.empty());
53 EXPECT_GT(result.usage.total_tokens, 0);
54
55 if (result.id.has_value()) {
56 EXPECT_FALSE(result.id->empty());
57 }
58}
59
60TEST_F(OpenAIIntegrationTest, TextGenerationWithSystemPrompt) {
61 if (!use_real_api_) {

Callers

nothing calls this directly

Calls 13

is_text_deltaMethod · 0.80
is_finishMethod · 0.80
is_errorMethod · 0.80
create_clientFunction · 0.50
generate_textMethod · 0.45
supports_modelMethod · 0.45
error_messageMethod · 0.45
is_successMethod · 0.45
stream_textMethod · 0.45
is_validMethod · 0.45
provider_nameMethod · 0.45
supported_modelsMethod · 0.45

Tested by

no test coverage detected