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

Function TestCreateFilterWithAmbiguousIDPrefixError

cli/command/service/ps_test.go:45–61  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

43}
44
45func 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
63func TestCreateFilterNoneFound(t *testing.T) {
64 apiClient := &fakeClient{}

Callers

nothing calls this directly

Calls 2

createFilterFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…