Updated, added a test for errorReplyNoCapability.

This commit is contained in:
Jeremy Fincher 2004-01-15 12:07:31 +00:00
parent 2a60ba61c5
commit b072772ea5

View File

@ -367,7 +367,7 @@ class PrivmsgTestCase(ChannelPluginTestCase):
class PrivmsgCommandAndRegexpTestCase(PluginTestCase): class PrivmsgCommandAndRegexpTestCase(PluginTestCase):
plugins = ('Utilities',) # Gotta put something. plugins = ()
class PCAR(callbacks.PrivmsgCommandAndRegexp): class PCAR(callbacks.PrivmsgCommandAndRegexp):
def test(self, irc, msg, args): def test(self, irc, msg, args):
"<foo>" "<foo>"
@ -376,12 +376,13 @@ class PrivmsgCommandAndRegexpTestCase(PluginTestCase):
self.irc.addCallback(self.PCAR()) self.irc.addCallback(self.PCAR())
self.assertResponse('test', 'test <foo>') self.assertResponse('test', 'test <foo>')
class RichReplyMethodsTestCase(unittest.TestCase): class RichReplyMethodsTestCase(PluginTestCase):
plugins = ()
class NoCapability(callbacks.Privmsg):
def error(self, irc, msg, args):
irc.errorNoCapability('admin')
def testErrorNoCapability(self): def testErrorNoCapability(self):
class NoCapability(callbacks.RichReplyMethods): self.irc.addCallback(self.NoCapability())
def error(self, s, **kwargs): self.assertRegexp('error', 'admin')
assert 'admin' in s
x = NoCapability()
x.errorNoCapability('admin')
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: # vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: