mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-29 21:54:22 +01:00
Fixed failing test for roulette.
This commit is contained in:
parent
2c5e6163a0
commit
d2c6d66214
@ -349,11 +349,10 @@ class Fun(callbacks.Privmsg):
|
||||
if not ircutils.isChannel(channel):
|
||||
irc.error('This message must be sent in a channel.')
|
||||
if random.randint(1, 6) == 1:
|
||||
if irc.nick not in irc.state.channels[channel].ops:
|
||||
irc.reply('*BANG* Hey, who put a blank in here?!',
|
||||
prefixName=False)
|
||||
else:
|
||||
if irc.nick in irc.state.channels[channel].ops:
|
||||
irc.queueMsg(ircmsgs.kick(channel, nick, 'BANG!'))
|
||||
else:
|
||||
irc.reply('*BANG* Hey, who put a blank in here?!')
|
||||
else:
|
||||
irc.reply('*click*')
|
||||
|
||||
|
@ -32,20 +32,24 @@
|
||||
from testsupport import *
|
||||
|
||||
import re
|
||||
import ircmsgs
|
||||
|
||||
import utils
|
||||
|
||||
class FunTest(ChannelPluginTestCase, PluginDocumentation):
|
||||
plugins = ('Fun',)
|
||||
def testRoulette(self):
|
||||
self.irc.feedMsg(ircmsgs.op(self.channel, self.irc.nick))
|
||||
sawKick = False
|
||||
for i in xrange(100):
|
||||
m = self.getMsg('roulette')
|
||||
m = self.getMsg('roulette', frm='someoneElse')
|
||||
if m.command == 'PRIVMSG':
|
||||
self.failUnless('click' in m.args[1].lower())
|
||||
self.failUnless('click' in m.args[1].lower(),
|
||||
'Got a PRIVMSG without click in it.')
|
||||
elif m.command == 'KICK':
|
||||
sawKick = True
|
||||
self.failUnless('bang' in m.args[2].lower())
|
||||
self.failUnless('bang' in m.args[2].lower(),
|
||||
'Got a KICK without bang in it.')
|
||||
else:
|
||||
self.fail('Got something other than a kick or a privmsg.')
|
||||
self.failUnless(sawKick, 'Didn\'t get a kick in %s iterations!' % i)
|
||||
|
Loading…
Reference in New Issue
Block a user