MCPcopy Create free account
hub / github.com/docker/cli / TestNetworkPrunePromptTermination

Function TestNetworkPrunePromptTermination

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

Source from the content-addressed store, hash-verified

11)
12
13func TestNetworkPrunePromptTermination(t *testing.T) {
14 ctx, cancel := context.WithCancel(context.Background())
15 t.Cleanup(cancel)
16
17 cli := test.NewFakeCli(&fakeClient{
18 networkPruneFunc: func(ctx context.Context, opts client.NetworkPruneOptions) (client.NetworkPruneResult, error) {
19 return client.NetworkPruneResult{}, errors.New("fakeClient networkPruneFunc 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…