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

Function TestUpdateMaxReplicas

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

Source from the content-addressed store, hash-verified

929}
930
931func TestUpdateMaxReplicas(t *testing.T) {
932 ctx := context.Background()
933
934 svc := swarm.ServiceSpec{
935 TaskTemplate: swarm.TaskSpec{
936 ContainerSpec: &swarm.ContainerSpec{},
937 Placement: &swarm.Placement{
938 MaxReplicas: 1,
939 },
940 },
941 }
942
943 flags := newUpdateCommand(nil).Flags()
944 flags.Set(flagMaxReplicas, "2")
945 err := updateService(ctx, nil, flags, &svc)
946 assert.NilError(t, err)
947
948 assert.DeepEqual(t, svc.TaskTemplate.Placement, &swarm.Placement{MaxReplicas: uint64(2)})
949}
950
951func TestUpdateSysCtls(t *testing.T) {
952 ctx := context.Background()

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…