update_test.go 467 B

1234567891011121314151617181920
  1. package service
  2. import (
  3. "testing"
  4. "github.com/docker/docker/pkg/testutil/assert"
  5. "github.com/docker/engine-api/types/swarm"
  6. )
  7. func TestUpdateServiceArgs(t *testing.T) {
  8. flags := newUpdateCommand(nil).Flags()
  9. flags.Set("args", "the \"new args\"")
  10. spec := &swarm.ServiceSpec{}
  11. cspec := &spec.TaskTemplate.ContainerSpec
  12. cspec.Args = []string{"old", "args"}
  13. updateService(flags, spec)
  14. assert.EqualStringSlice(t, cspec.Args, []string{"the", "new args"})
  15. }