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

Function TestRemoveWithForceOption

cli/command/plugin/remove_test.go:53–67  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

51}
52
53func TestRemoveWithForceOption(t *testing.T) {
54 force := false
55 cli := test.NewFakeCli(&fakeClient{
56 pluginRemoveFunc: func(name string, options client.PluginRemoveOptions) (client.PluginRemoveResult, error) {
57 force = options.Force
58 return client.PluginRemoveResult{}, nil
59 },
60 })
61 cmd := newRemoveCommand(cli)
62 cmd.SetArgs([]string{"plugin-foo"})
63 assert.NilError(t, cmd.Flags().Set("force", "true"))
64 assert.NilError(t, cmd.Execute())
65 assert.Check(t, force)
66 assert.Check(t, is.Equal("plugin-foo\n", cli.OutBuffer().String()))
67}

Callers

nothing calls this directly

Calls 5

OutBufferMethod · 0.95
SetArgsMethod · 0.80
newRemoveCommandFunction · 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…