Added success.

This commit is contained in:
Jeremy Fincher 2004-04-13 01:49:56 +00:00
parent d5ee023bfa
commit 72c0eb5d23
2 changed files with 16 additions and 1 deletions

View File

@ -47,13 +47,23 @@ import callbacks
class Utilities(callbacks.Privmsg):
def ignore(self, irc, msg, args):
"""takes no arguments
"""requires no arguments
Does nothing. Useful sometimes for sequencing commands when you don't
care about their non-error return values.
"""
pass
def success(self, irc, msg, args):
"""requires no arguments
Does nothing except to reply with a success message. This is useful
when you want to run multiple commands as nested commands, and don't
care about their output as long as they're successful. An error, of
course, will break out of this command.
"""
irc.replySuccess()
def strjoin(self, irc, msg, args):
"""<separator> <string 1> [<string> ...]

View File

@ -35,6 +35,11 @@ class UtilitiesTestCase(PluginTestCase):
plugins = ('Utilities', 'Status')
def testIgnore(self):
self.assertNoResponse('ignore foo bar baz', 1)
self.assertError('ignore [re m/foo bar]')
def testSuccess(self):
self.assertNotError('success 1')
self.assertError('success [re m/foo bar]')
def testStrjoin(self):
self.assertResponse('strjoin + foo bar baz', 'foo+bar+baz')