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

Function TestPrunePromptTermination

cli/command/image/prune_test.go:118–132  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

116}
117
118func TestPrunePromptTermination(t *testing.T) {
119 ctx, cancel := context.WithCancel(context.Background())
120 t.Cleanup(cancel)
121
122 cli := test.NewFakeCli(&fakeClient{
123 imagePruneFunc: func(client.ImagePruneOptions) (client.ImagePruneResult, error) {
124 return client.ImagePruneResult{}, errors.New("fakeClient imagePruneFunc should not be called")
125 },
126 })
127 cmd := newPruneCommand(cli)
128 cmd.SetArgs([]string{})
129 cmd.SetOut(io.Discard)
130 cmd.SetErr(io.Discard)
131 test.TerminatePrompt(ctx, t, cmd, cli)
132}

Callers

nothing calls this directly

Calls 4

SetArgsMethod · 0.80
newPruneCommandFunction · 0.70
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…