Made PluginTestCase handle multiple plugins.

This commit is contained in:
Jeremy Fincher 2003-08-11 05:15:16 +00:00
parent 0c8ee83f92
commit 09f2ae8412
2 changed files with 6 additions and 4 deletions

View File

@ -83,13 +83,17 @@ class PluginTestCase(unittest.TestCase):
for an example.
"""
timeout = 10
plugins = ()
def setUp(self, nick='test'):
self.nick = nick
self.prefix = ircutils.joinHostmask(nick, 'user', 'host.domain.tld')
self.irc = irclib.Irc(nick)
while self.irc.takeMsg():
pass
self.irc.addCallback(self.plugin)
for name in self.plugins:
module = __import__(name)
plugin = module.Class()
self.irc.addCallback(plugin)
def assertResponse(self, query, expectedResponse):
self.irc.feedMsg(ircmsgs.privmsg(self.nick, query, prefix=self.prefix))

View File

@ -31,10 +31,8 @@
from test import *
import FunCommands
class FunCommandsTest(PluginTestCase):
plugin = FunCommands.Class()
plugins = ('FunCommands',)
def testBinary(self):
self.assertResponse('binary A', '01000001')