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

Function TestRunPluginHooksPassesErrorMessage

cli-plugins/manager/hooks_test.go:293–308  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

291}
292
293func TestRunPluginHooksPassesErrorMessage(t *testing.T) {
294 cfg := configfile.New("")
295 cfg.Plugins = map[string]map[string]string{
296 "test-plugin": {"hooks": "build"},
297 }
298 provider := &fakeConfigProvider{cfg: cfg}
299 root := &cobra.Command{Use: "docker"}
300 sub := &cobra.Command{Use: "build"}
301 root.AddCommand(sub)
302
303 // Should not panic with empty error message (success case)
304 RunPluginHooks(context.Background(), provider, root, sub, []string{"build"}, "")
305
306 // Should not panic with non-empty error message (failure case)
307 RunPluginHooks(context.Background(), provider, root, sub, []string{"build"}, "exit status 1")
308}
309
310func TestRunPluginHooksErrorHooks(t *testing.T) {
311 cfg := configfile.New("")

Callers

nothing calls this directly

Calls 1

RunPluginHooksFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…