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

Function TestUpdateHostsPreservesOrder

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

Source from the content-addressed store, hash-verified

412}
413
414func TestUpdateHostsPreservesOrder(t *testing.T) {
415 flags := newUpdateCommand(nil).Flags()
416 flags.Set("host-add", "foobar:127.0.0.2")
417 flags.Set("host-add", "foobar:127.0.0.1")
418 flags.Set("host-add", "foobar:127.0.0.3")
419
420 hosts := []string{}
421 err := updateHosts(flags, &hosts)
422 assert.NilError(t, err)
423 assert.Check(t, is.DeepEqual([]string{"127.0.0.2 foobar", "127.0.0.1 foobar", "127.0.0.3 foobar"}, hosts))
424}
425
426func TestUpdateHostsReplaceEntry(t *testing.T) {
427 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…