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

Class OpenAIIntegrationTest

tests/integration/openai_integration_test.cpp:18–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16namespace test {
17
18class OpenAIIntegrationTest : public AITestFixture {
19 protected:
20 void SetUp() override {
21 AITestFixture::SetUp();
22
23 // Check if we should run real API tests
24 const char* api_key = std::getenv("OPENAI_API_KEY");
25
26 if (api_key && *api_key != '\0') {
27 use_real_api_ = true;
28 client_ = ai::openai::create_client(api_key);
29 } else {
30 use_real_api_ = false;
31 // Skip tests if no API key is available
32 }
33 }
34
35 void TearDown() override { AITestFixture::TearDown(); }
36
37 bool use_real_api_;
38 std::optional<ai::Client> client_;
39};
40
41// Basic API Connectivity Tests
42TEST_F(OpenAIIntegrationTest, BasicTextGeneration) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected