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

Function TestCliNewTagCommandErrors

cli/command/image/tag_test.go:13–27  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestCliNewTagCommandErrors(t *testing.T) {
14 testCases := [][]string{
15 {},
16 {"image1"},
17 {"image1", "image2", "image3"},
18 }
19 expectedError := "'tag' requires 2 arguments"
20 for _, args := range testCases {
21 cmd := newTagCommand(test.NewFakeCli(&fakeClient{}))
22 cmd.SetArgs(args)
23 cmd.SetOut(io.Discard)
24 cmd.SetErr(io.Discard)
25 assert.ErrorContains(t, cmd.Execute(), expectedError)
26 }
27}
28
29func TestCliNewTagCommand(t *testing.T) {
30 cmd := newTagCommand(

Callers

nothing calls this directly

Calls 4

newTagCommandFunction · 0.85
SetArgsMethod · 0.80
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…