Misc: add 'clearmores' command (Closes ProgVal/Limnoria#953)

This commit is contained in:
James Lu 2014-12-28 22:59:11 -08:00
parent 24879733e9
commit b6f798263b
2 changed files with 15 additions and 0 deletions

View File

@ -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:

View File

@ -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 []')