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

Function TestLoadAgentConfigInvalidYAML

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

Source from the content-addressed store, hash-verified

269}
270
271func TestLoadAgentConfigInvalidYAML(t *testing.T) {
272 tmpDir := t.TempDir()
273 configPath := filepath.Join(tmpDir, "invalid.yaml")
274
275 err := os.WriteFile(configPath, []byte("invalid: yaml: content: ["), 0644)
276 if err != nil {
277 t.Fatalf("failed to write test config: %v", err)
278 }
279
280 loader := NewLoader()
281 _, err = loader.LoadAgentConfig(configPath)
282 if err == nil {
283 t.Error("expected error for invalid YAML")
284 }
285}
286
287func TestLoadAgentConfigMissingRequiredField(t *testing.T) {
288 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 4

LoadAgentConfigMethod · 0.95
NewLoaderFunction · 0.70
ErrorMethod · 0.65
JoinMethod · 0.45

Tested by

no test coverage detected