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

Method TestWebhook_successIfEnabled

plugin/manager_test.go:130–143  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

128}
129
130func (s *ManagerSuite) TestWebhook_successIfEnabled() {
131 conf := s.getConfForExamplePlugin(1)
132
133 assert.Nil(s.T(), s.manager.SetPluginEnabled(conf.ID, true))
134 defer func() { assert.Nil(s.T(), s.manager.SetPluginEnabled(conf.ID, false)) }()
135 assert.True(s.T(), s.getConfForExamplePlugin(1).Enabled)
136
137 t := httptest.NewRequest("GET", fmt.Sprintf("/plugin/%d/custom/%s/echo", conf.ID, conf.Token), nil)
138
139 r := httptest.NewRecorder()
140 s.e.ServeHTTP(r, t)
141
142 assert.Equal(s.T(), 200, r.Code)
143}
144
145func (s *ManagerSuite) TestInitializePlugin_noOpIfEmpty() {
146 assert.Nil(s.T(), s.manager.loadPlugins(""))

Callers

nothing calls this directly

Calls 2

SetPluginEnabledMethod · 0.80

Tested by

no test coverage detected