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

Method TestAddRemoveNewUser

plugin/manager_test.go:279–291  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

277}
278
279func (s *ManagerSuite) TestAddRemoveNewUser() {
280 s.db.User(7)
281 s.makeDanglingPluginConf(7)
282
283 assert.Nil(s.T(), s.manager.InitializeForUserID(7))
284 pid := s.getConfForExamplePlugin(7).ID
285 assert.True(s.T(), s.manager.HasInstance(pid))
286
287 assert.Nil(s.T(), s.manager.SetPluginEnabled(s.getConfForMockPlugin(7).ID, true))
288
289 assert.Nil(s.T(), s.manager.RemoveUser(7))
290 assert.False(s.T(), s.manager.HasInstance(pid))
291}
292
293func (s *ManagerSuite) TestRemoveUser_DisableFail_cannotRemove() {
294 s.manager.initializeForUser(*s.db.NewUserWithName(8, "disable_fail_2"))

Callers

nothing calls this directly

Calls 8

getConfForMockPluginMethod · 0.95
UserMethod · 0.80
InitializeForUserIDMethod · 0.80
HasInstanceMethod · 0.80
SetPluginEnabledMethod · 0.80
RemoveUserMethod · 0.80

Tested by

no test coverage detected