MCPcopy
hub / github.com/helm/helm / TestLoadCLIPluginsForCompletion

Function TestLoadCLIPluginsForCompletion

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

Source from the content-addressed store, hash-verified

243}
244
245func TestLoadCLIPluginsForCompletion(t *testing.T) {
246 settings.PluginsDirectory = "testdata/helmhome/helm/plugins"
247
248 var out bytes.Buffer
249
250 cmd := &cobra.Command{
251 Use: "completion",
252 }
253 loadCLIPlugins(cmd, &out)
254
255 tests := []staticCompletionDetails{
256 {"args", []string{}, []string{}, []staticCompletionDetails{}},
257 {"echo", []string{}, []string{}, []staticCompletionDetails{}},
258 {"exitwith", []string{}, []string{}, []staticCompletionDetails{
259 {"code", []string{}, []string{"a", "b"}, []staticCompletionDetails{}},
260 }},
261 {"fullenv", []string{}, []string{"q", "z"}, []staticCompletionDetails{
262 {"empty", []string{}, []string{}, []staticCompletionDetails{}},
263 {"full", []string{}, []string{}, []staticCompletionDetails{
264 {"less", []string{}, []string{"a", "all"}, []staticCompletionDetails{}},
265 {"more", []string{"one", "two"}, []string{"b", "ball"}, []staticCompletionDetails{}},
266 }},
267 }},
268 {"shortenv", []string{}, []string{"global"}, []staticCompletionDetails{
269 {"list", []string{}, []string{"a", "all", "log"}, []staticCompletionDetails{}},
270 {"remove", []string{"all", "one"}, []string{}, []staticCompletionDetails{}},
271 }},
272 }
273 checkCommand(t, cmd.Commands(), tests)
274}
275
276func checkCommand(t *testing.T, plugins []*cobra.Command, tests []staticCompletionDetails) {
277 t.Helper()

Callers

nothing calls this directly

Calls 2

loadCLIPluginsFunction · 0.85
checkCommandFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…