runTurn wires a model against handler, submits `text`, drains the command chain, and returns the Model. token, when non-empty, is installed on both the active profile and the live llm.Client so cloud auth headers travel as in production.
(t *testing.T, handler http.HandlerFunc, token, text string)
| 1184 | // active profile and the live llm.Client so cloud auth headers travel as in |
| 1185 | // production. |
| 1186 | func runTurn(t *testing.T, handler http.HandlerFunc, token, text string) Model { |
| 1187 | t.Helper() |
| 1188 | m := newTestModel(t, handler) |
| 1189 | if token != "" { |
| 1190 | m.cfg.ActiveProfile().Key = token |
| 1191 | m.cli.Token = token |
| 1192 | } |
| 1193 | mm, cmd := m.submit(text, text, promptEntry{display: text}) |
| 1194 | out, _ := drain(mm, cmd) |
| 1195 | return out.(Model) |
| 1196 | } |
| 1197 | |
| 1198 | // budgetResponseHandler is a test LLM endpoint that answers with a single |
| 1199 | // "ok" message plus the budget header, using OpenAI SSE format. |
no test coverage detected