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

Function TestUpdateHostsReplaceEntry

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

Source from the content-addressed store, hash-verified

424}
425
426func TestUpdateHostsReplaceEntry(t *testing.T) {
427 flags := newUpdateCommand(nil).Flags()
428 flags.Set("host-add", "foobar:127.0.0.4")
429 flags.Set("host-rm", "foobar:127.0.0.2")
430
431 hosts := []string{"127.0.0.2 foobar", "127.0.0.1 foobar", "127.0.0.3 foobar"}
432
433 err := updateHosts(flags, &hosts)
434 assert.NilError(t, err)
435 assert.Check(t, is.DeepEqual([]string{"127.0.0.1 foobar", "127.0.0.3 foobar", "127.0.0.4 foobar"}, hosts))
436}
437
438func TestUpdateHostsRemoveHost(t *testing.T) {
439 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…