(t *testing.T)
| 81 | } |
| 82 | |
| 83 | func TestSecretListWithQuietOption(t *testing.T) { |
| 84 | cli := test.NewFakeCli(&fakeClient{ |
| 85 | secretListFunc: func(_ context.Context, options client.SecretListOptions) (client.SecretListResult, error) { |
| 86 | return client.SecretListResult{ |
| 87 | Items: []swarm.Secret{ |
| 88 | *builders.Secret(builders.SecretID("ID-foo"), builders.SecretName("foo")), |
| 89 | *builders.Secret(builders.SecretID("ID-bar"), builders.SecretName("bar"), builders.SecretLabels(map[string]string{ |
| 90 | "label": "label-bar", |
| 91 | })), |
| 92 | }, |
| 93 | }, nil |
| 94 | }, |
| 95 | }) |
| 96 | cmd := newSecretListCommand(cli) |
| 97 | assert.Check(t, cmd.Flags().Set("quiet", "true")) |
| 98 | assert.NilError(t, cmd.Execute()) |
| 99 | golden.Assert(t, cli.OutBuffer().String(), "secret-list-with-quiet-option.golden") |
| 100 | } |
| 101 | |
| 102 | func TestSecretListWithConfigFormat(t *testing.T) { |
| 103 | cli := test.NewFakeCli(&fakeClient{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…