MCPcopy
hub / github.com/gotify/server / Test_GetPlugins

Method Test_GetPlugins

api/plugin_test.go:83–98  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

81}
82
83func (s *PluginSuite) Test_GetPlugins() {
84 test.WithUser(s.ctx, 1)
85
86 s.ctx.Request = httptest.NewRequest("GET", "/plugin", nil)
87 s.a.GetPlugins(s.ctx)
88
89 assert.Equal(s.T(), 200, s.recorder.Code)
90
91 pluginConfs := make([]model.PluginConfExternal, 0)
92 assert.Nil(s.T(), json.Unmarshal(s.recorder.Body.Bytes(), &pluginConfs))
93
94 assert.Equal(s.T(), mock.Name, pluginConfs[0].Name)
95 assert.Equal(s.T(), mock.ModulePath, pluginConfs[0].ModulePath)
96
97 assert.False(s.T(), pluginConfs[0].Enabled, "Plugins should be disabled by default")
98}
99
100func (s *PluginSuite) Test_EnableDisablePlugin() {
101 {

Callers

nothing calls this directly

Calls 2

WithUserFunction · 0.92
GetPluginsMethod · 0.80

Tested by

no test coverage detected