TestErrorMessageUnauthorized: 401 names the rejected key and the exact config path so the user can fix it without guessing.
(t *testing.T)
| 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. |
| 1461 | func 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) |
nothing calls this directly
no test coverage detected