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

Function TestRemoveCurrent

cli/command/context/remove_test.go:34–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32}
33
34func TestRemoveCurrent(t *testing.T) {
35 cli := makeFakeCli(t)
36 createTestContexts(t, cli, "current", "other")
37 cli.SetCurrentContext("current")
38 err := runRemove(cli, removeOptions{}, []string{"current"})
39 assert.ErrorContains(t, err, `context "current" is in use, set -f flag to force remove`)
40}
41
42func TestRemoveCurrentForce(t *testing.T) {
43 configDir := t.TempDir()

Callers

nothing calls this directly

Calls 4

makeFakeCliFunction · 0.85
createTestContextsFunction · 0.85
SetCurrentContextMethod · 0.80
runRemoveFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…