MCPcopy
hub / github.com/docker/docker-agent / TestMaxIterationsRejectInJSONModeWithoutYolo

Function TestMaxIterationsRejectInJSONModeWithoutYolo

pkg/cli/runner_test.go:214–232  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

212}
213
214func TestMaxIterationsRejectInJSONModeWithoutYolo(t *testing.T) {
215 t.Parallel()
216
217 rt := &mockRuntime{
218 events: []runtime.Event{maxIterEvent(60)},
219 }
220
221 var buf bytes.Buffer
222 out := NewPrinter(&buf)
223 sess := session.New()
224 cfg := Config{AutoApprove: false, OutputJSON: true}
225
226 err := Run(t.Context(), out, cfg, rt, sess, []string{"hello"})
227 assert.NilError(t, err)
228
229 resumes := rt.getResumes()
230 assert.Equal(t, len(resumes), 1)
231 assert.Equal(t, resumes[0].Type, runtime.ResumeTypeReject)
232}
233
234// JSON mode has no stdin user — a ToolCallConfirmationEvent must be
235// rejected even under --yolo (AutoApprove=true), because the event

Callers

nothing calls this directly

Calls 6

getResumesMethod · 0.95
NewFunction · 0.92
maxIterEventFunction · 0.85
NewPrinterFunction · 0.85
ContextMethod · 0.80
RunFunction · 0.70

Tested by

no test coverage detected