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

Function TestLoad_GeminiBackendMinimal

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

Source from the content-addressed store, hash-verified

325}
326
327func TestLoad_GeminiBackendMinimal(t *testing.T) {
328 cfgPath := writeTempConfig(t, `
329backends:
330 - name: gem
331 type: gemini
332 timeout_ms: 100
333 api_key: AIza-test
334 default_model: gemini-2.0-flash
335 cost: { unit: 1, currency: credit }
336 capabilities: [chat]
337tenants:
338 - id: t1
339routing:
340 default_backend: gem
341reliability:
342 fallback_enabled: false
343`)
344
345 cfg, err := Load(cfgPath)
346 if err != nil {
347 t.Fatalf("expected config to load: %v", err)
348 }
349 b := cfg.Backends[0]
350 if b.Endpoint != "" {
351 t.Fatalf("expected empty endpoint for default base URL, got %q", b.Endpoint)
352 }
353 if b.DefaultModel != "gemini-2.0-flash" {
354 t.Fatalf("default_model: %q", b.DefaultModel)
355 }
356}
357
358func TestLoad_GeminiBackendMissingAPIKey(t *testing.T) {
359 cfgPath := writeTempConfig(t, `

Callers

nothing calls this directly

Calls 2

writeTempConfigFunction · 0.85
LoadFunction · 0.85

Tested by

no test coverage detected