(t *testing.T)
| 465 | } |
| 466 | |
| 467 | func 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 | |
| 480 | func TestUpdatePortsRmWithProtocol(t *testing.T) { |
| 481 | flags := newUpdateCommand(nil).Flags() |
nothing calls this directly
no test coverage detected
searching dependent graphs…