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

Function TestInvalidPlugin

cli/cobra_test.go:40–57  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

38}
39
40func TestInvalidPlugin(t *testing.T) {
41 root := &cobra.Command{Use: "root"}
42 sub1 := &cobra.Command{Use: "sub1"}
43 sub1sub1 := &cobra.Command{Use: "sub1sub1"}
44 sub1sub2 := &cobra.Command{Use: "sub1sub2"}
45 sub2 := &cobra.Command{Use: "sub2"}
46
47 assert.Assert(t, is.Len(invalidPlugins(root), 0))
48
49 sub1.Annotations = map[string]string{
50 metadata.CommandAnnotationPlugin: "true",
51 metadata.CommandAnnotationPluginInvalid: "foo",
52 }
53 root.AddCommand(sub1, sub2)
54 sub1.AddCommand(sub1sub1, sub1sub2)
55
56 assert.DeepEqual(t, invalidPlugins(root), []*cobra.Command{sub1}, cmpopts.IgnoreUnexported(cobra.Command{}))
57}
58
59func TestHiddenPlugin(t *testing.T) {
60 root := &cobra.Command{Use: "root"}

Callers

nothing calls this directly

Calls 2

invalidPluginsFunction · 0.85
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…