mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Added success.
This commit is contained in:
parent
d5ee023bfa
commit
72c0eb5d23
@ -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> ...]
|
||||
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user