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

Function TestVolumePrunePromptYes

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

Source from the content-addressed store, hash-verified

143}
144
145func TestVolumePrunePromptYes(t *testing.T) {
146 // FIXME(vdemeester) make it work..
147 skip.If(t, runtime.GOOS == "windows", "TODO: fix test on windows")
148
149 for _, input := range []string{"y", "Y"} {
150 cli := test.NewFakeCli(&fakeClient{
151 volumePruneFunc: simplePruneFunc,
152 })
153
154 cli.SetIn(streams.NewIn(io.NopCloser(strings.NewReader(input))))
155 cmd := newPruneCommand(cli)
156 cmd.SetArgs([]string{})
157 assert.NilError(t, cmd.Execute())
158 golden.Assert(t, cli.OutBuffer().String(), "volume-prune-yes.golden")
159 }
160}
161
162func TestVolumePrunePromptNo(t *testing.T) {
163 // FIXME(vdemeester) make it work..

Callers

nothing calls this directly

Calls 5

SetInMethod · 0.95
OutBufferMethod · 0.95
SetArgsMethod · 0.80
newPruneCommandFunction · 0.70
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…