diff --git a/test/test.py b/test/test.py index 22d435a41..06ef37b3c 100755 --- a/test/test.py +++ b/test/test.py @@ -111,7 +111,7 @@ class PluginTestCase(unittest.TestCase): for an example. """ timeout = 10 - plugins = () + plugins = None cleanConfDir = True cleanDataDir = True def setUp(self, nick='test'): @@ -125,20 +125,23 @@ class PluginTestCase(unittest.TestCase): debug.reset() ircdb.users.reload() ircdb.channels.reload() - if not self.plugins: + if self.plugins is None: raise ValueError, 'PluginTestCase must have a "plugins" attribute.' self.nick = nick self.prefix = ircutils.joinHostmask(nick, 'user', 'host.domain.tld') self.irc = irclib.Irc(nick) while self.irc.takeMsg(): pass + _ = Owner.loadPluginClass(self.irc, Owner) if isinstance(self.plugins, str): - module = Owner.loadPluginModule(self.plugins) - cb = Owner.loadPluginClass(self.irc, module) + if self.plugins != 'Owner': + module = Owner.loadPluginModule(self.plugins) + cb = Owner.loadPluginClass(self.irc, module) else: for name in self.plugins: - module = Owner.loadPluginModule(name) - cb = Owner.loadPluginClass(self.irc, module) + if name != 'Owner': + module = Owner.loadPluginModule(name) + cb = Owner.loadPluginClass(self.irc, module) def tearDown(self): self.irc.die() @@ -259,7 +262,6 @@ class PluginTestCase(unittest.TestCase): class ChannelPluginTestCase(PluginTestCase): channel = '#test' - def setUp(self): PluginTestCase.setUp(self) self.irc.feedMsg(ircmsgs.join(self.channel, prefix=self.prefix)) diff --git a/test/test_Misc.py b/test/test_Misc.py index b25bb9781..05e286567 100644 --- a/test/test_Misc.py +++ b/test/test_Misc.py @@ -32,8 +32,7 @@ from test import * class MiscTestCase(ChannelPluginTestCase, PluginDocumentation): - plugins = ('Misc', 'Owner', - 'Utilities', 'Gameknot', 'Ctcp') + plugins = ('Misc', 'Utilities', 'Gameknot', 'Ctcp') def testReplyWhenNotCommand(self): try: conf.replyWhenNotCommand = True diff --git a/test/test_MoobotFactoids.py b/test/test_MoobotFactoids.py index 7cf38eb9f..151d1efc9 100644 --- a/test/test_MoobotFactoids.py +++ b/test/test_MoobotFactoids.py @@ -38,7 +38,7 @@ except ImportError: if sqlite is not None: class FactoidsTestCase(PluginTestCase, PluginDocumentation): - plugins = ('Misc', 'MoobotFactoids', 'User') + plugins = ('Misc', 'MoobotFactoids', 'User', 'Utilities') def setUp(self): PluginTestCase.setUp(self) # Create a valid user to use @@ -185,6 +185,10 @@ if sqlite is not None: self.assertNotError('lock moo') self.assertError('no moo is qux') + def testRegexpNotCalledIfAlreadyHandled(self): + self.assertResponse('echo foo is bar', 'foo is bar') + self.assertNoResponse(' ', 3) + class DunnoTestCase(PluginTestCase, PluginDocumentation): plugins = ('Misc', 'MoobotFactoids', 'User') def setUp(self): diff --git a/test/test_Owner.py b/test/test_Owner.py index 38dfa159e..521c05305 100644 --- a/test/test_Owner.py +++ b/test/test_Owner.py @@ -35,7 +35,7 @@ import conf import Owner class OwnerTestCase(PluginTestCase, PluginDocumentation): - plugins = ('Owner',) + plugins = () def testEval(self): try: originalConfAllowEval = conf.allowEval diff --git a/test/test_Status.py b/test/test_Status.py index 4b592348a..0e9b5bcf2 100644 --- a/test/test_Status.py +++ b/test/test_Status.py @@ -34,7 +34,7 @@ from test import * import world class StatusTestCase(PluginTestCase, PluginDocumentation): - plugins = ('Status', 'Owner') + plugins = ('Status',) def testBestuptime(self): self.assertNotRegexp('bestuptime', '33 years') self.assertNotError('unload Status') diff --git a/test/test_callbacks.py b/test/test_callbacks.py index 5950254ae..e34981ed7 100644 --- a/test/test_callbacks.py +++ b/test/test_callbacks.py @@ -163,7 +163,7 @@ class FunctionsTestCase(unittest.TestCase): class PrivmsgTestCase(ChannelPluginTestCase): - plugins = ('Utilities', 'Owner', 'Misc') + plugins = ('Utilities', 'Misc') conf.allowEval = True timeout = 2 def testEmptySquareBrackets(self):