MCPcopy Create free account
hub / github.com/astercloud/aster / TestLoadModelConfig

Function TestLoadModelConfig

pkg/config/loader_test.go:310–340  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

308}
309
310func TestLoadModelConfig(t *testing.T) {
311 tmpDir := t.TempDir()
312 configPath := filepath.Join(tmpDir, "model.yaml")
313
314 configContent := `
315provider: "anthropic"
316model: "claude-3-5-sonnet"
317api_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
342func TestMergeConfigs(t *testing.T) {
343 base := &types.AgentConfig{

Callers

nothing calls this directly

Calls 3

LoadModelConfigMethod · 0.95
NewLoaderFunction · 0.70
JoinMethod · 0.45

Tested by

no test coverage detected