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

Function TestClientDebugEnabled

cmd/docker/docker_test.go:41–56  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

39}
40
41func TestClientDebugEnabled(t *testing.T) {
42 defer debug.Disable()
43 ctx := t.Context()
44
45 cli, err := command.NewDockerCli(command.WithBaseContext(ctx))
46 assert.NilError(t, err)
47 tcmd := newDockerCommand(cli)
48 tcmd.SetFlag("debug", "true")
49 cmd, _, err := tcmd.HandleGlobalFlags()
50 assert.NilError(t, err)
51 assert.NilError(t, tcmd.Initialize())
52 err = cmd.PersistentPreRunE(cmd, []string{})
53 assert.NilError(t, err)
54 assert.Check(t, is.Equal("1", os.Getenv("DEBUG")))
55 assert.Check(t, is.Equal(logrus.DebugLevel, logrus.GetLevel()))
56}
57
58var discard = io.NopCloser(bytes.NewBuffer(nil))
59

Callers

nothing calls this directly

Calls 4

newDockerCommandFunction · 0.85
SetFlagMethod · 0.80
HandleGlobalFlagsMethod · 0.80
InitializeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…