Esempio n. 1
0
 def test_is_admin_with_nickserv(self, _get, _CFG):
     util._BOT.factory.nspassword = "******"
     util._BOT.identified_admins = ["superman"]
     _get.return_value = "superman,gandalf"
     _CFG.getboolean.return_value = True
     self.assertTrue(pluginmanager.is_admin("superman"))
     self.assertFalse(pluginmanager.is_admin("i'm-no-superman"))
Esempio n. 2
0
 def test_is_admin_partial_match(self, mock):
     mock.return_value = "superman,gandalf"
     self.assertFalse(pluginmanager.is_admin("gandal"))
Esempio n. 3
0
 def test_is_admin_with_explicitly_disabled_nickserv(self, _get, _CFG):
     util._BOT.factory.nspassword = "******"
     _get.return_value = "superman,gandalf"
     _CFG.getboolean.return_value = False
     self.assertTrue(pluginmanager.is_admin("superman"))
     self.assertFalse(pluginmanager.is_admin("i'm-no-superman"))
Esempio n. 4
0
 def test_is_admin_no_nickserv(self, mock):
     util._BOT.factory.nspassword = None
     mock.return_value = "superman,gandalf"
     self.assertTrue(pluginmanager.is_admin("superman"))
     self.assertFalse(pluginmanager.is_admin("i'm-no-superman"))