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

Function TestHumanOutputProducesStyledTable

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

Source from the content-addressed store, hash-verified

9)
10
11func TestHumanOutputProducesStyledTable(t *testing.T) {
12 t.Parallel()
13
14 t.Run("Should produce styled table", func(t *testing.T) {
15 t.Parallel()
16
17 deps := newTestDeps(t, &stubClient{
18 listAgentsFn: func(_ context.Context, _ AgentQuery) ([]AgentRecord, error) {
19 return []AgentRecord{{
20 Name: "coder",
21 Provider: "codex",
22 Model: "gpt-5.4",
23 Tools: []string{"shell", "edit"},
24 Permissions: "approve-reads",
25 }}, nil
26 },
27 })
28
29 stdout, _, err := executeRootCommand(t, deps, "agent", "list", "-o", "human")
30 if err != nil {
31 t.Fatalf("executeRootCommand() error = %v", err)
32 }
33 if !strings.Contains(stdout, "Agents") || !strings.Contains(stdout, "Provider") ||
34 !strings.Contains(stdout, "----") {
35 t.Fatalf("human output = %q, want styled table", stdout)
36 }
37 })
38}
39
40func TestJSONOutputProducesValidJSON(t *testing.T) {
41 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