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

Function TestUpdateServiceArgs

cli/command/service/update_test.go:21–35  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19)
20
21func TestUpdateServiceArgs(t *testing.T) {
22 flags := newUpdateCommand(nil).Flags()
23 flags.Set("args", "the \"new args\"")
24
25 spec := &swarm.ServiceSpec{
26 TaskTemplate: swarm.TaskSpec{
27 ContainerSpec: &swarm.ContainerSpec{},
28 },
29 }
30 cspec := spec.TaskTemplate.ContainerSpec
31 cspec.Args = []string{"old", "args"}
32
33 updateService(context.TODO(), nil, flags, spec)
34 assert.Check(t, is.DeepEqual([]string{"the", "new args"}, cspec.Args))
35}
36
37func TestUpdateLabels(t *testing.T) {
38 flags := newUpdateCommand(nil).Flags()

Callers

nothing calls this directly

Calls 3

updateServiceFunction · 0.85
newUpdateCommandFunction · 0.70
SetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…