(t *testing.T)
| 264 | } |
| 265 | |
| 266 | func TestElicitationAutoDeclineInJSONMode(t *testing.T) { |
| 267 | t.Parallel() |
| 268 | |
| 269 | rt := &mockRuntime{ |
| 270 | events: []runtime.Event{ |
| 271 | &runtime.ElicitationRequestEvent{ |
| 272 | Type: "elicitation_request", |
| 273 | Message: "Please authorize", |
| 274 | Meta: map[string]any{"docker-agent/server_url": "https://example.com"}, |
| 275 | }, |
| 276 | }, |
| 277 | } |
| 278 | |
| 279 | var buf bytes.Buffer |
| 280 | out := NewPrinter(&buf) |
| 281 | sess := session.New() |
| 282 | cfg := Config{OutputJSON: true} |
| 283 | |
| 284 | err := Run(t.Context(), out, cfg, rt, sess, []string{"hello"}) |
| 285 | assert.NilError(t, err) |
| 286 | |
| 287 | rt.mu.Lock() |
| 288 | defer rt.mu.Unlock() |
| 289 | assert.Equal(t, rt.elicitationDeclines, 1) |
| 290 | assert.Equal(t, rt.elicitationLastAction, tools.ElicitationAction("decline")) |
| 291 | } |
| 292 | |
| 293 | func TestMaxIterationsSafetyCapJSONMode(t *testing.T) { |
| 294 | t.Parallel() |
nothing calls this directly
no test coverage detected