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

Function TestCreateErrorOnFileAsContextDir

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

Source from the content-addressed store, hash-verified

47}
48
49func TestCreateErrorOnFileAsContextDir(t *testing.T) {
50 tmpFile := fs.NewFile(t, "file-as-context-dir")
51 defer tmpFile.Remove()
52
53 cli := test.NewFakeCli(&fakeClient{})
54 cmd := newCreateCommand(cli)
55 cmd.SetArgs([]string{"plugin-foo", tmpFile.Path()})
56 cmd.SetOut(io.Discard)
57 cmd.SetErr(io.Discard)
58 assert.ErrorContains(t, cmd.Execute(), "context must be a directory")
59}
60
61func TestCreateErrorOnContextDirWithoutConfig(t *testing.T) {
62 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…