mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Made PluginTestCase handle multiple plugins.
This commit is contained in:
parent
0c8ee83f92
commit
09f2ae8412
@ -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))
|
||||
|
@ -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')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user