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

Function TestUpdateInit

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

Source from the content-addressed store, hash-verified

592}
593
594func TestUpdateInit(t *testing.T) {
595 spec := &swarm.ServiceSpec{
596 TaskTemplate: swarm.TaskSpec{
597 ContainerSpec: &swarm.ContainerSpec{},
598 },
599 }
600 cspec := spec.TaskTemplate.ContainerSpec
601
602 // Update with --init=true
603 flags := newUpdateCommand(nil).Flags()
604 flags.Set("init", "true")
605 updateService(context.TODO(), nil, flags, spec)
606 assert.Check(t, is.Equal(true, *cspec.Init))
607
608 // Update without --init, no change
609 flags = newUpdateCommand(nil).Flags()
610 updateService(context.TODO(), nil, flags, spec)
611 assert.Check(t, is.Equal(true, *cspec.Init))
612
613 // Update with --init=false
614 flags = newUpdateCommand(nil).Flags()
615 flags.Set("init", "false")
616 updateService(context.TODO(), nil, flags, spec)
617 assert.Check(t, is.Equal(false, *cspec.Init))
618}
619
620func TestUpdateStopSignal(t *testing.T) {
621 spec := &swarm.ServiceSpec{

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…