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

Function TestHandleGatewayCommand_Dispatch

cli/gateway_command_test.go:180–191  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

178}
179
180func TestHandleGatewayCommand_Dispatch(t *testing.T) {
181 t.Setenv("HOME", t.TempDir())
182 for _, e := range []string{"CHATCLI_TELEGRAM_BOT_TOKEN", "CHATCLI_DISCORD_BOT_TOKEN", "CHATCLI_SLACK_ADDR", "CHATCLI_WHATSAPP_ADDR", "CHATCLI_WEBHOOK_ADDR"} {
183 t.Setenv(e, "")
184 }
185 c := &ChatCLI{logger: zap.NewNop()}
186 // Each branch must dispatch without panicking.
187 c.handleGatewayCommand("/gateway") // -> start (no adapters)
188 c.handleGatewayCommand("/gateway status") // -> status
189 c.handleGatewayCommand("/gateway stop") // -> stop (not running)
190 c.handleGatewayCommand("/gateway nope") // -> usage
191}
192
193func TestGatewayStartDetached_AlreadyRunning(t *testing.T) {
194 tmp := t.TempDir()

Callers

nothing calls this directly

Calls 1

handleGatewayCommandMethod · 0.95

Tested by

no test coverage detected