(t *testing.T)
| 325 | } |
| 326 | |
| 327 | func TestLoad_GeminiBackendMinimal(t *testing.T) { |
| 328 | cfgPath := writeTempConfig(t, ` |
| 329 | backends: |
| 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] |
| 337 | tenants: |
| 338 | - id: t1 |
| 339 | routing: |
| 340 | default_backend: gem |
| 341 | reliability: |
| 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 | |
| 358 | func TestLoad_GeminiBackendMissingAPIKey(t *testing.T) { |
| 359 | cfgPath := writeTempConfig(t, ` |
nothing calls this directly
no test coverage detected