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

Function TestErrorMessageBudgetExhausted

internal/tui/tui_test.go:1471–1480  ·  view source on GitHub ↗

TestErrorMessageBudgetExhausted: 402 produces the depleted hint pointing users at the top-up page rather than a stack-trace style wrap.

(t *testing.T)

Source from the content-addressed store, hash-verified

1469 }
1470 if strings.Contains(msg, "ollama") {
1471 t.Fatalf("error should be backend-neutral (no 'ollama'): %q", msg)
1472 }
1473}
1474
1475// TestErrorMessageUnauthorized: 401 names the rejected key and the exact
1476// config path so the user can fix it without guessing.
1477func TestErrorMessageUnauthorized(t *testing.T) {
1478 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
1479 msg := m.errorMessage(llm.Event{Err: cloud.ErrUnauthorized})
1480 if !strings.Contains(msg, "key rejected") {
1481 t.Fatalf("401 error should say 'key rejected': %q", msg)
1482 }
1483 if !strings.Contains(msg, "models."+m.cfg.Active+".key") {

Callers

nothing calls this directly

Calls 2

newTestModelFunction · 0.85
errorMessageMethod · 0.80

Tested by

no test coverage detected