MCPcopy Create free account
hub / github.com/diillson/chatcli / TestRouteConfigCommand

Function TestRouteConfigCommand

cli/config_sections_test.go:94–115  ·  view source on GitHub ↗

routeConfigCommand dispatches on the subsection name. An unknown name prints a hint without panicking, and routing is case-insensitive.

(t *testing.T)

Source from the content-addressed store, hash-verified

92// routeConfigCommand dispatches on the subsection name. An unknown name
93// prints a hint without panicking, and routing is case-insensitive.
94func TestRouteConfigCommand(t *testing.T) {
95 c := minimalCLI(t)
96
97 tests := []struct {
98 name string
99 args []string
100 wantToken string // substring expected in captured output
101 }{
102 {"empty → panorama", []string{}, "PANORAMA"},
103 {"general", []string{"general"}, "GENERAL"},
104 {"AGENT caps", []string{"AGENT"}, "AGENT RUNTIME"},
105 {"unknown section", []string{"bogus"}, "Unknown section"},
106 }
107 for _, tt := range tests {
108 t.Run(tt.name, func(t *testing.T) {
109 out := captureStdout(t, func() { c.routeConfigCommand(context.Background(), tt.args) })
110 if !strings.Contains(out, tt.wantToken) {
111 t.Errorf("expected output to contain %q, got:\n%s", tt.wantToken, out)
112 }
113 })
114 }
115}
116
117// Server section short-circuits with a "skipped" notice when no
118// server-mode envs are set. When any of them is set it prints the full

Callers

nothing calls this directly

Calls 5

minimalCLIFunction · 0.85
routeConfigCommandMethod · 0.80
ErrorfMethod · 0.80
captureStdoutFunction · 0.70
RunMethod · 0.65

Tested by

no test coverage detected