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

Function TestSystemPrunePromptTermination

cli/command/system/prune_test.go:52–70  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

50}
51
52func TestSystemPrunePromptTermination(t *testing.T) {
53 ctx, cancel := context.WithCancel(context.Background())
54 t.Cleanup(cancel)
55
56 cli := test.NewFakeCli(&fakeClient{
57 containerPruneFunc: func(context.Context, client.ContainerPruneOptions) (client.ContainerPruneResult, error) {
58 return client.ContainerPruneResult{}, errors.New("fakeClient containerPruneFunc should not be called")
59 },
60 networkPruneFunc: func(context.Context, client.NetworkPruneOptions) (client.NetworkPruneResult, error) {
61 return client.NetworkPruneResult{}, errors.New("fakeClient networkPruneFunc should not be called")
62 },
63 })
64
65 cmd := newPruneCommand(cli)
66 cmd.SetArgs([]string{})
67 cmd.SetOut(io.Discard)
68 cmd.SetErr(io.Discard)
69 test.TerminatePrompt(ctx, t, cmd, cli)
70}

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…