MCPcopy Create free account
hub / github.com/compozy/agh / TestToonOutputProducesToonDocument

Function TestToonOutputProducesToonDocument

internal/cli/format_test.go:76–96  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

74}
75
76func TestToonOutputProducesToonDocument(t *testing.T) {
77 t.Parallel()
78
79 t.Run("Should produce TOON document", func(t *testing.T) {
80 t.Parallel()
81
82 deps := newTestDeps(t, &stubClient{
83 listAgentsFn: func(_ context.Context, _ AgentQuery) ([]AgentRecord, error) {
84 return []AgentRecord{{Name: "coder", Provider: "codex", Tools: []string{"shell"}}}, nil
85 },
86 })
87
88 stdout, _, err := executeRootCommand(t, deps, "agent", "list", "-o", "toon")
89 if err != nil {
90 t.Fatalf("executeRootCommand() error = %v", err)
91 }
92 if !strings.Contains(stdout, "agents[1]{name,provider,model,category,tool_count,permissions}:") {
93 t.Fatalf("toon output = %q, want TOON header", stdout)
94 }
95 })
96}
97
98func TestAgentCategoryLabel(t *testing.T) {
99 t.Parallel()

Callers

nothing calls this directly

Calls 4

newTestDepsFunction · 0.85
executeRootCommandFunction · 0.85
ContainsMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected