INNER CODE UNIT · Go
TestAgentsList_WithDescription
jrswab/axe · cmd/agents_test.go:123
func TestAgentsList_WithDescription(t *testing.T) {
agentsDir := setupTestAgentsDir(t)
writeTestAgent(t, agentsDir, "helper", "name = \"helper\"\nmodel = \"openai/gpt-4o\"\ndescription = \"A helpful agent\"")
buf := new(bytes.Buffer)
rootCmd.SetOut(buf)
rootCmd.SetErr(new(bytes.Buffer))
rootCmd.SetArgs([]string{"agents", "list"})
err := rootCmd.Execute()
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
want := "helper - A helpful agent\n"
if buf.String() != want {
t.Errorf("output = %q, want %q", buf.String(), want)
}