MCPcopy Index your code
hub / github.com/docker/docker-agent / TestMaxIterationsAutoApproveInYoloMode

Function TestMaxIterationsAutoApproveInYoloMode

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

Source from the content-addressed store, hash-verified

140}
141
142func TestMaxIterationsAutoApproveInYoloMode(t *testing.T) {
143 t.Parallel()
144
145 rt := &mockRuntime{
146 events: []runtime.Event{maxIterEvent(60)},
147 }
148
149 var buf bytes.Buffer
150 out := NewPrinter(&buf)
151 sess := session.New()
152 cfg := Config{AutoApprove: true}
153
154 err := Run(t.Context(), out, cfg, rt, sess, []string{"hello"})
155 assert.NilError(t, err)
156
157 resumes := rt.getResumes()
158 assert.Equal(t, len(resumes), 1)
159 assert.Equal(t, resumes[0].Type, runtime.ResumeTypeApprove)
160}
161
162func TestMaxIterationsAutoApproveSafetyCap(t *testing.T) {
163 t.Parallel()

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