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

Function TestNewListCommandAmbiguous

cli/command/image/list_test.go:107–119  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

105}
106
107func TestNewListCommandAmbiguous(t *testing.T) {
108 cli := test.NewFakeCli(&fakeClient{})
109 cmd := newImagesCommand(cli)
110 cmd.SetOut(io.Discard)
111
112 // Set the Use field to mimic that the command was called as "docker images",
113 // not "docker image ls".
114 cmd.Use = "images"
115 cmd.SetArgs([]string{"ls"})
116 err := cmd.Execute()
117 assert.NilError(t, err)
118 golden.Assert(t, cli.ErrBuffer().String(), "list-command-ambiguous.golden")
119}
120
121func TestImagesFilterDangling(t *testing.T) {
122 // Create test images with different states

Callers

nothing calls this directly

Calls 5

ErrBufferMethod · 0.95
newImagesCommandFunction · 0.85
SetArgsMethod · 0.80
StringMethod · 0.65
SetOutMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…