mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-19 08:59:27 +01:00
Added a TestPlugin with eval.
This commit is contained in:
parent
360cba9c63
commit
596abe02f0
@ -109,6 +109,17 @@ class TimeoutError(AssertionError):
|
||||
def __str__(self):
|
||||
return '%r timed out' % self.args[0]
|
||||
|
||||
class TestPlugin(callbacks.Privmsg):
|
||||
def eval(self, irc, msg, args):
|
||||
"""<text>
|
||||
|
||||
This is the help for eval.
|
||||
"""
|
||||
try:
|
||||
irc.reply(repr(eval(' '.join(args))))
|
||||
except Exception, e:
|
||||
irc.reply(utils.exnToString(e))
|
||||
TestInstance = TestPlugin()
|
||||
|
||||
class SupyTestCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
@ -194,6 +205,7 @@ class PluginTestCase(SupyTestCase):
|
||||
if name not in ('Owner', 'Misc', 'Config'):
|
||||
module = Owner.loadPluginModule(name,ignoreDeprecation=True)
|
||||
cb = Owner.loadPluginClass(self.irc, module)
|
||||
self.irc.addCallback(TestInstance)
|
||||
for (name, value) in self.config.iteritems():
|
||||
group = conf.supybot
|
||||
parts = registry.split(name)
|
||||
|
Loading…
Reference in New Issue
Block a user