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

Function TestCreateErrorOnContextDirWithoutConfig

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

Source from the content-addressed store, hash-verified

59}
60
61func TestCreateErrorOnContextDirWithoutConfig(t *testing.T) {
62 tmpDir := fs.NewDir(t, "plugin-create-test")
63 defer tmpDir.Remove()
64
65 cli := test.NewFakeCli(&fakeClient{})
66 cmd := newCreateCommand(cli)
67 cmd.SetArgs([]string{"plugin-foo", tmpDir.Path()})
68 cmd.SetOut(io.Discard)
69 cmd.SetErr(io.Discard)
70
71 expectedErr := "config.json: no such file or directory"
72 if runtime.GOOS == "windows" {
73 expectedErr = "config.json: The system cannot find the file specified."
74 }
75 assert.ErrorContains(t, cmd.Execute(), expectedErr)
76}
77
78func TestCreateErrorOnInvalidConfig(t *testing.T) {
79 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…