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

Function TestCliNewTagCommand

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

Source from the content-addressed store, hash-verified

27}
28
29func TestCliNewTagCommand(t *testing.T) {
30 cmd := newTagCommand(
31 test.NewFakeCli(&fakeClient{
32 imageTagFunc: func(options client.ImageTagOptions) (client.ImageTagResult, error) {
33 assert.Check(t, is.Equal("image1", options.Source))
34 assert.Check(t, is.Equal("image2", options.Target))
35 return client.ImageTagResult{}, nil
36 },
37 }))
38 cmd.SetArgs([]string{"image1", "image2"})
39 cmd.SetOut(io.Discard)
40 assert.NilError(t, cmd.Execute())
41 value, _ := cmd.Flags().GetBool("interspersed")
42 assert.Check(t, !value)
43}

Callers

nothing calls this directly

Calls 3

newTagCommandFunction · 0.85
SetArgsMethod · 0.80
SetOutMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…