mirror of https://github.com/Mikaela/Limnoria.git
Make sure the ban length is an integer
This commit is contained in:
parent
42ce8c33a6
commit
e485984604
|
@ -183,7 +183,11 @@ class Channel(callbacks.Privmsg):
|
|||
self.log.warning('%r tried to make me kban myself.', msg.prefix)
|
||||
irc.error(msg, 'I cowardly refuse to kickban myself.')
|
||||
return
|
||||
try:
|
||||
length = int(length or 0)
|
||||
except ValueError:
|
||||
irc.error(msg, 'Ban length must be a valid integer.')
|
||||
return
|
||||
try:
|
||||
bannedHostmask = irc.state.nickToHostmask(bannedNick)
|
||||
except KeyError:
|
||||
|
|
|
@ -96,6 +96,7 @@ class ChannelTestCase(ChannelPluginTestCase, PluginDocumentation):
|
|||
m = self.getMsg(' ')
|
||||
self.assertEqual(m, ircmsgs.kick(self.channel, 'foobar', self.nick))
|
||||
self.assertNotRegexp('kban adlkfajsdlfkjsd', 'KeyError')
|
||||
self.assertNotRegexp('kban foobar time', 'ValueError')
|
||||
self.assertError('kban %s' % self.nick)
|
||||
|
||||
def testLobotomizers(self):
|
||||
|
|
Loading…
Reference in New Issue