MCPcopy Index your code
hub / github.com/helm/helm / TestManuallyProcessArgs

Function TestManuallyProcessArgs

pkg/cmd/plugin_test.go:34–84  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32)
33
34func TestManuallyProcessArgs(t *testing.T) {
35 input := []string{
36 "--debug",
37 "--foo", "bar",
38 "--kubeconfig=/home/foo",
39 "--kubeconfig", "/home/foo",
40 "--kube-context=test1",
41 "--kube-context", "test1",
42 "--kube-as-user", "pikachu",
43 "--kube-as-group", "teatime",
44 "--kube-as-group", "admins",
45 "-n=test2",
46 "-n", "test2",
47 "--namespace=test2",
48 "--namespace", "test2",
49 "--home=/tmp",
50 "command",
51 }
52
53 expectKnown := []string{
54 "--debug",
55 "--kubeconfig=/home/foo",
56 "--kubeconfig", "/home/foo",
57 "--kube-context=test1",
58 "--kube-context", "test1",
59 "--kube-as-user", "pikachu",
60 "--kube-as-group", "teatime",
61 "--kube-as-group", "admins",
62 "-n=test2",
63 "-n", "test2",
64 "--namespace=test2",
65 "--namespace", "test2",
66 }
67
68 expectUnknown := []string{
69 "--foo", "bar", "--home=/tmp", "command",
70 }
71
72 known, unknown := manuallyProcessArgs(input)
73
74 for i, k := range known {
75 if k != expectKnown[i] {
76 t.Errorf("expected known flag %d to be %q, got %q", i, expectKnown[i], k)
77 }
78 }
79 for i, k := range unknown {
80 if k != expectUnknown[i] {
81 t.Errorf("expected unknown flag %d to be %q, got %q", i, expectUnknown[i], k)
82 }
83 }
84}
85
86func TestLoadCLIPlugins(t *testing.T) {
87 settings.PluginsDirectory = "testdata/helmhome/helm/plugins"

Callers

nothing calls this directly

Calls 1

manuallyProcessArgsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…