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

Function prepare

e2e/cli-plugins/util_test.go:15–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13)
14
15func prepare(t *testing.T) (func(args ...string) icmd.Cmd, *configfile.ConfigFile, func()) {
16 t.Helper()
17 cfg := fs.NewDir(t, "plugin-test",
18 fs.WithFile("config.json", fmt.Sprintf(`{"cliPluginsExtraDirs": [%q]}`, os.Getenv("DOCKER_CLI_E2E_PLUGINS_EXTRA_DIRS"))),
19 )
20 run := func(args ...string) icmd.Cmd {
21 return icmd.Command("docker", append([]string{"--config", cfg.Path()}, args...)...)
22 }
23 cleanup := func() {
24 cfg.Remove()
25 }
26 cfgfile, err := config.Load(cfg.Path())
27 assert.NilError(t, err)
28
29 return run, cfgfile, cleanup
30}

Callers 15

TestConfigFunction · 0.85
TestGlobalHelpFunction · 0.85
TestRunGoodArgumentFunction · 0.85
TestClashWithGlobalArgsFunction · 0.85
TestUnknownGlobalFunction · 0.85
TestCliPluginsVersionFunction · 0.85
TestRunNonexistingFunction · 0.85
TestHelpNonexistingFunction · 0.85
TestNonexistingHelpFunction · 0.85

Calls 3

PathMethod · 0.65
RemoveMethod · 0.65
CommandMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…