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

Function TestVolumeListWithConfigFormat

cli/command/volume/list_test.go:70–90  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

68}
69
70func 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
92func TestVolumeListWithFormat(t *testing.T) {
93 cli := test.NewFakeCli(&fakeClient{

Callers

nothing calls this directly

Calls 4

SetConfigFileMethod · 0.95
OutBufferMethod · 0.95
newListCommandFunction · 0.70
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…