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

Function TestPruneServices

cli/command/stack/deploy_test.go:25–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23}
24
25func TestPruneServices(t *testing.T) {
26 ctx := context.Background()
27 namespace := convert.NewNamespace("foo")
28 services := map[string]struct{}{
29 "new": {},
30 "keep": {},
31 }
32 apiClient := &fakeClient{services: []string{objectName("foo", "keep"), objectName("foo", "remove")}}
33 dockerCli := test.NewFakeCli(apiClient)
34
35 pruneServices(ctx, dockerCli, namespace, services)
36 assert.Check(t, is.DeepEqual(buildObjectIDs([]string{objectName("foo", "remove")}), apiClient.removedServices))
37}
38
39// TestServiceUpdateResolveImageChanged tests that the service's
40// image digest, and "ForceUpdate" is preserved if the image did not change in

Callers

nothing calls this directly

Calls 3

objectNameFunction · 0.85
pruneServicesFunction · 0.85
buildObjectIDsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…