(t *testing.T)
| 100 | } |
| 101 | |
| 102 | func TestSecretListWithConfigFormat(t *testing.T) { |
| 103 | cli := test.NewFakeCli(&fakeClient{ |
| 104 | secretListFunc: func(_ context.Context, options client.SecretListOptions) (client.SecretListResult, error) { |
| 105 | return client.SecretListResult{ |
| 106 | Items: []swarm.Secret{ |
| 107 | *builders.Secret(builders.SecretID("ID-foo"), builders.SecretName("foo")), |
| 108 | *builders.Secret(builders.SecretID("ID-bar"), builders.SecretName("bar"), builders.SecretLabels(map[string]string{ |
| 109 | "label": "label-bar", |
| 110 | })), |
| 111 | }, |
| 112 | }, nil |
| 113 | }, |
| 114 | }) |
| 115 | cli.SetConfigFile(&configfile.ConfigFile{ |
| 116 | SecretFormat: "{{ .Name }} {{ .Labels }}", |
| 117 | }) |
| 118 | cmd := newSecretListCommand(cli) |
| 119 | assert.NilError(t, cmd.Execute()) |
| 120 | golden.Assert(t, cli.OutBuffer().String(), "secret-list-with-config-format.golden") |
| 121 | } |
| 122 | |
| 123 | func TestSecretListWithFormat(t *testing.T) { |
| 124 | cli := test.NewFakeCli(&fakeClient{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…