MCPcopy
hub / github.com/apache/devlake / TestHub

Function TestHub

backend/core/plugin/hub_test.go:57–74  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

55}
56
57func TestHub(t *testing.T) {
58 var foo Foo
59 assert.Nil(t, RegisterPlugin("foo", &foo))
60 var bar Bar
61 assert.Nil(t, RegisterPlugin("bar", &bar))
62
63 f, _ := GetPlugin("foo")
64 assert.Equal(t, &foo, f)
65
66 fn, _ := FindPluginNameBySubPkgPath("path/to/foo/models")
67 assert.Equal(t, fn, "foo")
68
69 b, _ := GetPlugin("bar")
70 assert.Equal(t, &bar, b)
71
72 bn, _ := FindPluginNameBySubPkgPath("path/to/bar/models")
73 assert.Equal(t, bn, "bar")
74}

Callers

nothing calls this directly

Calls 3

RegisterPluginFunction · 0.85
GetPluginFunction · 0.85

Tested by

no test coverage detected