(t *testing.T)
| 287 | } |
| 288 | |
| 289 | func TestContainerListWithConfigFormat(t *testing.T) { |
| 290 | cli := test.NewFakeCli(&fakeClient{ |
| 291 | containerListFunc: func(_ client.ContainerListOptions) (client.ContainerListResult, error) { |
| 292 | return client.ContainerListResult{ |
| 293 | Items: []container.Summary{ |
| 294 | *builders.Container("c1", builders.WithLabel("some.label", "value"), builders.WithSize(10700000)), |
| 295 | *builders.Container("c2", builders.WithName("foo/bar"), builders.WithLabel("foo", "bar"), builders.WithSize(3200000)), |
| 296 | }, |
| 297 | }, nil |
| 298 | }, |
| 299 | }) |
| 300 | cli.SetConfigFile(&configfile.ConfigFile{ |
| 301 | PsFormat: "{{ .Names }} {{ .Image }} {{ .Labels }} {{ .Size}}", |
| 302 | }) |
| 303 | cmd := newListCommand(cli) |
| 304 | cmd.SetArgs([]string{}) |
| 305 | cmd.SetOut(io.Discard) |
| 306 | cmd.SetErr(io.Discard) |
| 307 | assert.NilError(t, cmd.Execute()) |
| 308 | golden.Assert(t, cli.OutBuffer().String(), "container-list-with-config-format.golden") |
| 309 | } |
| 310 | |
| 311 | func TestContainerListWithFormat(t *testing.T) { |
| 312 | cli := test.NewFakeCli(&fakeClient{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…