MCPcopy Create free account
hub / github.com/docker/cli / TestUpdateHostsRemoveAll

Function TestUpdateHostsRemoveAll

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

Source from the content-addressed store, hash-verified

465}
466
467func TestUpdateHostsRemoveAll(t *testing.T) {
468 flags := newUpdateCommand(nil).Flags()
469 flags.Set("host-add", "host-three:127.0.0.4")
470 flags.Set("host-add", "host-one:127.0.0.5")
471 flags.Set("host-rm", "host-one")
472
473 hosts := []string{"127.0.0.1 host-one", "127.0.0.2 host-two", "127.0.0.3 host-one"}
474
475 err := updateHosts(flags, &hosts)
476 assert.NilError(t, err)
477 assert.Check(t, is.DeepEqual([]string{"127.0.0.2 host-two", "127.0.0.4 host-three", "127.0.0.5 host-one"}, hosts))
478}
479
480func TestUpdatePortsRmWithProtocol(t *testing.T) {
481 flags := newUpdateCommand(nil).Flags()

Callers

nothing calls this directly

Calls 3

updateHostsFunction · 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…