(t *testing.T)
| 43 | } |
| 44 | |
| 45 | func TestCreateFilterWithAmbiguousIDPrefixError(t *testing.T) { |
| 46 | apiClient := &fakeClient{ |
| 47 | serviceListFunc: func(ctx context.Context, options client.ServiceListOptions) (client.ServiceListResult, error) { |
| 48 | return client.ServiceListResult{ |
| 49 | Items: []swarm.Service{ |
| 50 | {ID: "aaaone"}, |
| 51 | {ID: "aaatwo"}, |
| 52 | }, |
| 53 | }, nil |
| 54 | }, |
| 55 | } |
| 56 | _, _, err := createFilter(context.Background(), apiClient, psOptions{ |
| 57 | services: []string{"aaa"}, |
| 58 | filter: opts.NewFilterOpt(), |
| 59 | }) |
| 60 | assert.Error(t, err, "multiple services found with provided prefix: aaa") |
| 61 | } |
| 62 | |
| 63 | func TestCreateFilterNoneFound(t *testing.T) { |
| 64 | apiClient := &fakeClient{} |
nothing calls this directly
no test coverage detected
searching dependent graphs…