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

Function TestBuildMCPEmptyNote

cli/agent_mode_test.go:329–353  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

327}
328
329func TestBuildMCPEmptyNote(t *testing.T) {
330 if got := buildMCPEmptyNote(nil); got != "" {
331 t.Errorf("no servers should yield empty note, got %q", got)
332 }
333 if got := buildMCPEmptyNote([]mcp.ServerStatus{}); got != "" {
334 t.Errorf("empty slice should yield empty note, got %q", got)
335 }
336 starting := buildMCPEmptyNote([]mcp.ServerStatus{
337 {Name: "a", Starting: true},
338 {Name: "b", Connected: false},
339 })
340 // Both locales must surface that the server is not ready yet
341 // (en: "not ready yet" / "launching"; pt-BR: "ainda não está pronto").
342 if !strings.Contains(starting, "not ready") && !strings.Contains(starting, "launching") &&
343 !strings.Contains(starting, "ainda não está pronto") && !strings.Contains(starting, "iniciando") {
344 t.Errorf("starting note missing keyword:\n%s", starting)
345 }
346 failed := buildMCPEmptyNote([]mcp.ServerStatus{
347 {Name: "a", Connected: false},
348 })
349 // en: "no server is connected"; pt-BR: "nenhum servidor está conectado".
350 if !strings.Contains(failed, "no server is connected") && !strings.Contains(failed, "nenhum servidor está conectado") {
351 t.Errorf("unavailable note missing keyword:\n%s", failed)
352 }
353}
354
355func TestMCPConfigWatcherFiresOnFileWrite(t *testing.T) {
356 dir := t.TempDir()

Callers

nothing calls this directly

Calls 2

buildMCPEmptyNoteFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected