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

Function TestContainerPrunePromptTermination

cli/command/container/prune_test.go:13–27  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestContainerPrunePromptTermination(t *testing.T) {
14 ctx, cancel := context.WithCancel(context.Background())
15 t.Cleanup(cancel)
16
17 cli := test.NewFakeCli(&fakeClient{
18 containerPruneFunc: func(ctx context.Context, opts client.ContainerPruneOptions) (client.ContainerPruneResult, error) {
19 return client.ContainerPruneResult{}, errors.New("fakeClient containerPruneFunc should not be called")
20 },
21 })
22 cmd := newPruneCommand(cli)
23 cmd.SetArgs([]string{})
24 cmd.SetOut(io.Discard)
25 cmd.SetErr(io.Discard)
26 test.TerminatePrompt(ctx, t, cmd, cli)
27}

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…