(t *testing.T)
| 17 | ) |
| 18 | |
| 19 | func TestServiceListOrder(t *testing.T) { |
| 20 | cli := test.NewFakeCli(&fakeClient{ |
| 21 | serviceListFunc: func(ctx context.Context, options client.ServiceListOptions) (client.ServiceListResult, error) { |
| 22 | return client.ServiceListResult{ |
| 23 | Items: []swarm.Service{ |
| 24 | newService("a57dbe8", "service-1-foo"), |
| 25 | newService("a57dbdd", "service-10-foo"), |
| 26 | newService("aaaaaaa", "service-2-foo"), |
| 27 | }, |
| 28 | }, nil |
| 29 | }, |
| 30 | }) |
| 31 | cmd := newListCommand(cli) |
| 32 | cmd.SetArgs([]string{}) |
| 33 | assert.Check(t, cmd.Flags().Set("format", "{{.Name}}")) |
| 34 | assert.NilError(t, cmd.Execute()) |
| 35 | golden.Assert(t, cli.OutBuffer().String(), "service-list-sort.golden") |
| 36 | } |
| 37 | |
| 38 | // TestServiceListServiceStatus tests that the ServiceStatus struct is correctly |
| 39 | // propagated. For older API versions, the ServiceStatus is calculated locally, |
nothing calls this directly
no test coverage detected
searching dependent graphs…