(t *testing.T)
| 68 | } |
| 69 | |
| 70 | func TestVolumeListWithConfigFormat(t *testing.T) { |
| 71 | cli := test.NewFakeCli(&fakeClient{ |
| 72 | volumeListFunc: func(client.VolumeListOptions) (client.VolumeListResult, error) { |
| 73 | return client.VolumeListResult{ |
| 74 | Items: []volume.Volume{ |
| 75 | builders.Volume(), |
| 76 | builders.Volume(builders.VolumeName("foo"), builders.VolumeDriver("bar")), |
| 77 | builders.Volume(builders.VolumeName("baz"), builders.VolumeLabels(map[string]string{ |
| 78 | "foo": "bar", |
| 79 | })), |
| 80 | }, |
| 81 | }, nil |
| 82 | }, |
| 83 | }) |
| 84 | cli.SetConfigFile(&configfile.ConfigFile{ |
| 85 | VolumesFormat: "{{ .Name }} {{ .Driver }} {{ .Labels }}", |
| 86 | }) |
| 87 | cmd := newListCommand(cli) |
| 88 | assert.NilError(t, cmd.Execute()) |
| 89 | golden.Assert(t, cli.OutBuffer().String(), "volume-list-with-config-format.golden") |
| 90 | } |
| 91 | |
| 92 | func TestVolumeListWithFormat(t *testing.T) { |
| 93 | cli := test.NewFakeCli(&fakeClient{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…