mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 19:31:00 +00:00
test: cover Google telephony TTS private network opt-in
This commit is contained in:
@@ -344,4 +344,31 @@ describe("Google speech provider", () => {
|
||||
expect.objectContaining({ allowPrivateNetwork: true }),
|
||||
);
|
||||
});
|
||||
|
||||
it("honors configured private-network opt-in for Google telephony TTS", async () => {
|
||||
installGoogleTtsFetchMock();
|
||||
const postJsonRequestSpy = vi.spyOn(providerHttp, "postJsonRequest");
|
||||
|
||||
const provider = buildGoogleSpeechProvider();
|
||||
await provider.synthesizeTelephony?.({
|
||||
text: "hello",
|
||||
cfg: {
|
||||
models: {
|
||||
providers: {
|
||||
google: {
|
||||
baseUrl: "https://generativelanguage.googleapis.com/v1beta",
|
||||
request: { allowPrivateNetwork: true },
|
||||
models: [],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
providerConfig: { apiKey: "google-test-key" },
|
||||
timeoutMs: 12_345,
|
||||
});
|
||||
|
||||
expect(postJsonRequestSpy).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ allowPrivateNetwork: true }),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user