MCPcopy Create free account
hub / github.com/InferCore/InferCore / TestLoad_GeminiBackendMissingAPIKey

Function TestLoad_GeminiBackendMissingAPIKey

internal/config/config_test.go:358–378  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

356}
357
358func TestLoad_GeminiBackendMissingAPIKey(t *testing.T) {
359 cfgPath := writeTempConfig(t, `
360backends:
361 - name: gem
362 type: gemini
363 timeout_ms: 100
364 default_model: gemini-2.0-flash
365 cost: { unit: 1, currency: credit }
366tenants:
367 - id: t1
368routing:
369 default_backend: gem
370reliability:
371 fallback_enabled: false
372`)
373
374 _, err := Load(cfgPath)
375 if err == nil || !strings.Contains(err.Error(), "requires api_key") {
376 t.Fatalf("expected gemini api_key validation error, got: %v", err)
377 }
378}
379
380func TestLoad_GeminiBackendMissingDefaultModel(t *testing.T) {
381 cfgPath := writeTempConfig(t, `

Callers

nothing calls this directly

Calls 3

writeTempConfigFunction · 0.85
LoadFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected