Files
moloapp/tests/example/google/status_test.cpp
T
retoorandClaude Sonnet 5.5 837de58136 feat(clients): google cloud voice: generic client, TTS, STT, Gemini audio, live voice page
src/google: GoogleClient over molo::clients (key in x-goog-api-key, never in
URLs), Service base, TextToSpeech, SpeechToText, Generative (replies, audio
in, audio out), Recognizer/Synthesizer seams with cloud, gemini and vertex
backends, VoicePipeline with bounded history. Example: /voice live
conversation page, /voice/{say,hear,turn,reset}, /google/status. Keys load
from env, .env.json.local, .env.json. Paid routes are excluded from locust.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 04:05:41 +02:00

33 lines
1.2 KiB
C++

// Route: GET /google/status (credential state and known Google services)
#include "support/GoogleRig.hpp"
using namespace molo::example::test;
int main() {
{
GoogleRig rig;
Fixture f(rig.client);
auto res = f.client->get("/google/status");
check(res.status == 200, "status 200");
check(contains(res.headers.get("Content-Type"), "application/json"), "json");
check(contains(res.body, "\"configured\":true"), "configured with a key");
check(contains(res.body, "\"name\":\"texttospeech\"") &&
contains(res.body, "\"name\":\"speech\"") &&
contains(res.body, "\"name\":\"generativelanguage\""),
"lists the known services");
check(contains(res.body, "https://texttospeech.googleapis.com/v1"),
"base urls shown");
check(!contains(res.body, kTestKey), "credential never shown");
check(rig.mock->send_count() == 0, "side effect: no upstream traffic");
}
{
GoogleRig rig(false);
Fixture f(rig.client);
check(contains(f.client->get("/google/status").body, "\"configured\":false"),
"not configured without a key");
}
Fixture f;
check(f.client->post("/google/status").status == 405, "post is 405");
return finish("google/status");
}