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

Function TestContainerListNoTrunc

cli/command/container/list_test.go:172–190  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

170}
171
172func TestContainerListNoTrunc(t *testing.T) {
173 cli := test.NewFakeCli(&fakeClient{
174 containerListFunc: func(_ client.ContainerListOptions) (client.ContainerListResult, error) {
175 return client.ContainerListResult{
176 Items: []container.Summary{
177 *builders.Container("c1"),
178 *builders.Container("c2", builders.WithName("foo/bar")),
179 },
180 }, nil
181 },
182 })
183 cmd := newListCommand(cli)
184 cmd.SetArgs([]string{})
185 cmd.SetOut(io.Discard)
186 cmd.SetErr(io.Discard)
187 assert.Check(t, cmd.Flags().Set("no-trunc", "true"))
188 assert.NilError(t, cmd.Execute())
189 golden.Assert(t, cli.OutBuffer().String(), "container-list-without-format-no-trunc.golden")
190}
191
192// Test for GitHub issue docker/docker#21772
193func TestContainerListNamesMultipleTime(t *testing.T) {

Callers

nothing calls this directly

Calls 8

OutBufferMethod · 0.95
ContainerMethod · 0.80
SetArgsMethod · 0.80
newListCommandFunction · 0.70
StringMethod · 0.65
SetOutMethod · 0.45
SetErrMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…