MCPcopy Index your code
hub / github.com/docker/cli / TestVolumePrunePromptTerminate

Function TestVolumePrunePromptTerminate

cli/command/volume/prune_test.go:194–210  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

192}
193
194func TestVolumePrunePromptTerminate(t *testing.T) {
195 ctx, cancel := context.WithCancel(context.Background())
196 t.Cleanup(cancel)
197
198 cli := test.NewFakeCli(&fakeClient{
199 volumePruneFunc: func(options client.VolumePruneOptions) (client.VolumePruneResult, error) {
200 return client.VolumePruneResult{}, errors.New("fakeClient volumePruneFunc should not be called")
201 },
202 })
203
204 cmd := newPruneCommand(cli)
205 cmd.SetArgs([]string{})
206 cmd.SetOut(io.Discard)
207 cmd.SetErr(io.Discard)
208 test.TerminatePrompt(ctx, t, cmd, cli)
209 golden.Assert(t, cli.OutBuffer().String(), "volume-prune-terminate.golden")
210}

Callers

nothing calls this directly

Calls 6

OutBufferMethod · 0.95
SetArgsMethod · 0.80
newPruneCommandFunction · 0.70
StringMethod · 0.65
SetOutMethod · 0.45
SetErrMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…