From 2c7c83b07d4259259e5d7a859b427ad7fa670ba1 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Wed, 19 Dec 2018 09:38:07 +0100 Subject: [PATCH] Success: Declare __slots__ Required since 1ac7812d7a0c02dd440094ac5d8e035a4564a7a5. --- plugins/Success/plugin.py | 1 + plugins/Success/test.py | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/plugins/Success/plugin.py b/plugins/Success/plugin.py index 37ab09f74..68c68a048 100644 --- a/plugins/Success/plugin.py +++ b/plugins/Success/plugin.py @@ -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: diff --git a/plugins/Success/test.py b/plugins/Success/test.py index 19a513c1d..f4686e296 100644 --- a/plugins/Success/test.py +++ b/plugins/Success/test.py @@ -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: