MCPcopy
hub / github.com/helm/helm / TestLoadAllPluginsDir_Zero

Function TestLoadAllPluginsDir_Zero

internal/plugin/loader_test.go:235–261  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

233}
234
235func TestLoadAllPluginsDir_Zero(t *testing.T) {
236 cases := []struct {
237 name string
238 plugdirs string
239 expected int
240 }{
241 {
242 name: "plugdirs is empty",
243 plugdirs: t.TempDir(),
244 },
245 {
246 name: "plugdirs isn't dir",
247 plugdirs: "./plugin_test.go",
248 },
249 {
250 name: "plugdirs doesn't have plugin",
251 plugdirs: ".",
252 },
253 }
254 for _, c := range cases {
255 t.Run(t.Name(), func(t *testing.T) {
256 plugin, err := LoadAllDir(c.plugdirs, func(_ string, err error) error { return err })
257 require.NoError(t, err)
258 assert.Len(t, plugin, c.expected, "expected %d plugins, got %d", c.expected, len(plugin))
259 })
260 }
261}
262
263func TestLoadMetadataLegacy(t *testing.T) {
264 testCases := map[string]struct {

Callers

nothing calls this directly

Calls 4

LoadAllDirFunction · 0.85
RunMethod · 0.65
NameMethod · 0.65
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…