Success: Declare __slots__

Required since 1ac7812d7a.
This commit is contained in:
Valentin Lorentz 2018-12-19 09:38:07 +01:00
parent 06400596e9
commit 2c7c83b07d
2 changed files with 15 additions and 2 deletions

View File

@ -48,6 +48,7 @@ class Success(plugins.ChannelIdDatabasePlugin):
pluginSelf = self
self.originalClass = conf.supybot.replies.success.__class__
class MySuccessClass(self.originalClass):
__slots__ = ()
def __call__(self):
ret = pluginSelf.db.random(dynamic.msg.args[0])
if ret is None:

View File

@ -27,10 +27,22 @@
# POSSIBILITY OF SUCH DAMAGE.
###
import supybot.conf as conf
from supybot.test import *
class SuccessTestCase(PluginTestCase):
plugins = ('Success',)
class SuccessTestCase(ChannelPluginTestCase):
plugins = ('Success', 'User')
def setUp(self):
ChannelPluginTestCase.setUp(self)
self.prefix = 'mf2!bar@baz'
self.irc.feedMsg(ircmsgs.privmsg(self.nick, 'register tester moo',
prefix=self.prefix))
def testSuccess(self):
self.assertResponse('success add success1:', 'The operation succeeded.')
self.assertResponse('success add success2:',
'success1: Success #1 added.')
# vim:set shiftwidth=4 softtabstop=8 expandtab textwidth=78: