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

Function TestCreatePlugin

cli/command/plugin/create_test.go:109–125  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

107}
108
109func TestCreatePlugin(t *testing.T) {
110 tmpDir := fs.NewDir(t, "plugin-create-test",
111 fs.WithDir("rootfs"),
112 fs.WithFile("config.json", `{ "Name": "plugin-foo" }`))
113 defer tmpDir.Remove()
114
115 cli := test.NewFakeCli(&fakeClient{
116 pluginCreateFunc: func(createContext io.Reader, createOptions client.PluginCreateOptions) (client.PluginCreateResult, error) {
117 return client.PluginCreateResult{}, nil
118 },
119 })
120
121 cmd := newCreateCommand(cli)
122 cmd.SetArgs([]string{"plugin-foo", tmpDir.Path()})
123 assert.NilError(t, cmd.Execute())
124 assert.Check(t, is.Equal("plugin-foo\n", cli.OutBuffer().String()))
125}

Callers

nothing calls this directly

Calls 6

OutBufferMethod · 0.95
SetArgsMethod · 0.80
newCreateCommandFunction · 0.70
RemoveMethod · 0.65
PathMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…