MCPcopy Index your code
hub / github.com/docker/cli / TestUpdateGroups

Function TestUpdateGroups

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

Source from the content-addressed store, hash-verified

172}
173
174func TestUpdateGroups(t *testing.T) {
175 flags := newUpdateCommand(nil).Flags()
176 flags.Set("group-add", "wheel")
177 flags.Set("group-add", "docker")
178 flags.Set("group-rm", "root")
179 flags.Set("group-add", "foo")
180 flags.Set("group-rm", "docker")
181
182 groups := []string{"bar", "root"}
183
184 updateGroups(flags, &groups)
185 assert.Assert(t, is.Len(groups, 3))
186 assert.Check(t, is.Equal("bar", groups[0]))
187 assert.Check(t, is.Equal("foo", groups[1]))
188 assert.Check(t, is.Equal("wheel", groups[2]))
189}
190
191func TestUpdateDNSConfig(t *testing.T) {
192 flags := newUpdateCommand(nil).Flags()

Callers

nothing calls this directly

Calls 4

updateGroupsFunction · 0.85
newUpdateCommandFunction · 0.70
SetMethod · 0.45
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…