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

Callers

nothing calls this directly

Calls 2

newTestModelFunction · 0.85
errorMessageMethod · 0.80

Tested by

no test coverage detected