Skip to content

Commit

Permalink
Misc: add 'clearmores' command (Closes #953)
Browse files Browse the repository at this point in the history
  • Loading branch information
James Lu committed Dec 29, 2014
1 parent 2487973 commit b6f7982
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions plugins/Misc/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,15 @@ def match(nick):
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:
6 changes: 6 additions & 0 deletions plugins/Misc/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,12 @@ def testMore(self):
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 []')

Expand Down

0 comments on commit b6f7982

Please sign in to comment.