mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 12:42:34 +01:00
Misc: add 'clearmores' command (Closes ProgVal/Limnoria#953)
This commit is contained in:
parent
24879733e9
commit
b6f798263b
@ -606,6 +606,15 @@ class Misc(callbacks.Plugin):
|
||||
completenick = wrap(completenick, ['channel', 'something',
|
||||
getopts({'match-case':''})])
|
||||
|
||||
@internationalizeDocstring
|
||||
def clearmores(self, irc, msg, args):
|
||||
"""takes no arguments
|
||||
|
||||
Clears all mores for the current network."""
|
||||
irc._mores.clear()
|
||||
irc.replySuccess()
|
||||
clearmores = wrap(clearmores, ['admin'])
|
||||
|
||||
Class = Misc
|
||||
|
||||
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
|
||||
|
@ -225,6 +225,12 @@ class MiscTestCase(ChannelPluginTestCase):
|
||||
self.assertIsNot(m, None)
|
||||
self.assertNotIn('more', m.args[1])
|
||||
|
||||
def testClearMores(self):
|
||||
self.assertRegexp('echo %s' % ('abc'*700), 'more')
|
||||
self.assertRegexp('more', 'more')
|
||||
self.assertNotError('clearmores')
|
||||
self.assertError('more')
|
||||
|
||||
def testInvalidCommand(self):
|
||||
self.assertError('echo []')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user