(t *testing.T)
| 308 | } |
| 309 | |
| 310 | func TestLoadModelConfig(t *testing.T) { |
| 311 | tmpDir := t.TempDir() |
| 312 | configPath := filepath.Join(tmpDir, "model.yaml") |
| 313 | |
| 314 | configContent := ` |
| 315 | provider: "anthropic" |
| 316 | model: "claude-3-5-sonnet" |
| 317 | api_key: "sk-test" |
| 318 | ` |
| 319 | |
| 320 | err := os.WriteFile(configPath, []byte(configContent), 0644) |
| 321 | if err != nil { |
| 322 | t.Fatalf("failed to write test config: %v", err) |
| 323 | } |
| 324 | |
| 325 | loader := NewLoader() |
| 326 | config, err := loader.LoadModelConfig(configPath) |
| 327 | if err != nil { |
| 328 | t.Fatalf("LoadModelConfig failed: %v", err) |
| 329 | } |
| 330 | |
| 331 | if config.Provider != "anthropic" { |
| 332 | t.Errorf("expected provider 'anthropic', got %q", config.Provider) |
| 333 | } |
| 334 | if config.Model != "claude-3-5-sonnet" { |
| 335 | t.Errorf("expected model 'claude-3-5-sonnet', got %q", config.Model) |
| 336 | } |
| 337 | if config.APIKey != "sk-test" { |
| 338 | t.Errorf("expected api_key 'sk-test', got %q", config.APIKey) |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | func TestMergeConfigs(t *testing.T) { |
| 343 | base := &types.AgentConfig{ |
nothing calls this directly
no test coverage detected