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

Function TestGetProviderSuggestions

cli/provider_command_test.go:55–69  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

53}
54
55func TestGetProviderSuggestions(t *testing.T) {
56 cli := newProviderTestCLI("OPENAI", []string{"OPENAI", "CLAUDEAI", "XAI"})
57
58 if got := cli.getProviderSuggestions(paletteDoc("/provider ")); len(got) != 3 {
59 t.Fatalf("bare /provider suggestions = %d, want 3", len(got))
60 }
61 got := cli.getProviderSuggestions(paletteDoc("/provider CL"))
62 if len(got) != 1 || got[0].Text != "CLAUDEAI" {
63 t.Errorf("prefix CL = %v, want [CLAUDEAI]", got)
64 }
65 // Once a provider is chosen there is nothing more to complete.
66 if got := cli.getProviderSuggestions(paletteDoc("/provider OPENAI ")); len(got) != 0 {
67 t.Errorf("after a provider is chosen, want 0 suggestions, got %d", len(got))
68 }
69}
70
71func TestHandleProviderCommand(t *testing.T) {
72 t.Setenv("HOME", t.TempDir()) // isolate the runtime-model state file write

Callers

nothing calls this directly

Calls 4

newProviderTestCLIFunction · 0.85
paletteDocFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected