MCPcopy Create free account
hub / github.com/codehamr/codehamr / TestErrorMessageUnauthorized

Function TestErrorMessageUnauthorized

internal/tui/tui_test.go:1458–1467  ·  view source on GitHub ↗

TestErrorMessageUnauthorized: 401 names the rejected key and the exact config path so the user can fix it without guessing.

(t *testing.T)

Source from the content-addressed store, hash-verified

1456 t.Fatalf("disconnected label must include profile name and '!' marker: %q", got)
1457 }
1458}
1459
1460// TestErrorMessageUnreachable verifies the unreachable hint names the active
1461// profile's URL and steers the user toward /models to switch profiles.
1462func TestErrorMessageUnreachable(t *testing.T) {
1463 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
1464 m.cfg.ActiveProfile().URL = "http://localhost:11434"
1465
1466 msg := m.errorMessage(llm.Event{Err: cloud.ErrUnreachable{Err: fmt.Errorf("dial: refused")}})
1467 if !strings.Contains(msg, "unreachable") {
1468 t.Fatalf("error must say 'unreachable': %q", msg)
1469 }
1470 if !strings.Contains(msg, m.cfg.ActiveProfile().URL) {

Callers

nothing calls this directly

Calls 2

newTestModelFunction · 0.85
errorMessageMethod · 0.80

Tested by

no test coverage detected