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

Function TestCreateErrorOnInvalidConfig

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

Source from the content-addressed store, hash-verified

76}
77
78func TestCreateErrorOnInvalidConfig(t *testing.T) {
79 tmpDir := fs.NewDir(t, "plugin-create-test",
80 fs.WithDir("rootfs"),
81 fs.WithFile("config.json", "invalid-config-contents"))
82 defer tmpDir.Remove()
83
84 cli := test.NewFakeCli(&fakeClient{})
85 cmd := newCreateCommand(cli)
86 cmd.SetArgs([]string{"plugin-foo", tmpDir.Path()})
87 cmd.SetOut(io.Discard)
88 cmd.SetErr(io.Discard)
89 assert.ErrorContains(t, cmd.Execute(), "invalid")
90}
91
92func TestCreateErrorFromDaemon(t *testing.T) {
93 tmpDir := fs.NewDir(t, "plugin-create-test",

Callers

nothing calls this directly

Calls 6

SetArgsMethod · 0.80
newCreateCommandFunction · 0.70
RemoveMethod · 0.65
PathMethod · 0.65
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…