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

Function TestVolumePruneForce

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

Source from the content-addressed store, hash-verified

119}
120
121func TestVolumePruneForce(t *testing.T) {
122 testCases := []struct {
123 name string
124 volumePruneFunc func(options client.VolumePruneOptions) (client.VolumePruneResult, error)
125 }{
126 {
127 name: "empty",
128 },
129 {
130 name: "deletedVolumes",
131 volumePruneFunc: simplePruneFunc,
132 },
133 }
134 for _, tc := range testCases {
135 cli := test.NewFakeCli(&fakeClient{
136 volumePruneFunc: tc.volumePruneFunc,
137 })
138 cmd := newPruneCommand(cli)
139 cmd.Flags().Set("force", "true")
140 assert.NilError(t, cmd.Execute())
141 golden.Assert(t, cli.OutBuffer().String(), fmt.Sprintf("volume-prune.%s.golden", tc.name))
142 }
143}
144
145func TestVolumePrunePromptYes(t *testing.T) {
146 // FIXME(vdemeester) make it work..

Callers

nothing calls this directly

Calls 4

OutBufferMethod · 0.95
newPruneCommandFunction · 0.70
StringMethod · 0.65
SetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…