mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-30 22:24:20 +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):
|
if not ircutils.isChannel(channel):
|
||||||
irc.error('This message must be sent in a channel.')
|
irc.error('This message must be sent in a channel.')
|
||||||
if random.randint(1, 6) == 1:
|
if random.randint(1, 6) == 1:
|
||||||
if irc.nick not in irc.state.channels[channel].ops:
|
if irc.nick in irc.state.channels[channel].ops:
|
||||||
irc.reply('*BANG* Hey, who put a blank in here?!',
|
|
||||||
prefixName=False)
|
|
||||||
else:
|
|
||||||
irc.queueMsg(ircmsgs.kick(channel, nick, 'BANG!'))
|
irc.queueMsg(ircmsgs.kick(channel, nick, 'BANG!'))
|
||||||
|
else:
|
||||||
|
irc.reply('*BANG* Hey, who put a blank in here?!')
|
||||||
else:
|
else:
|
||||||
irc.reply('*click*')
|
irc.reply('*click*')
|
||||||
|
|
||||||
|
@ -32,20 +32,24 @@
|
|||||||
from testsupport import *
|
from testsupport import *
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import ircmsgs
|
||||||
|
|
||||||
import utils
|
import utils
|
||||||
|
|
||||||
class FunTest(ChannelPluginTestCase, PluginDocumentation):
|
class FunTest(ChannelPluginTestCase, PluginDocumentation):
|
||||||
plugins = ('Fun',)
|
plugins = ('Fun',)
|
||||||
def testRoulette(self):
|
def testRoulette(self):
|
||||||
|
self.irc.feedMsg(ircmsgs.op(self.channel, self.irc.nick))
|
||||||
sawKick = False
|
sawKick = False
|
||||||
for i in xrange(100):
|
for i in xrange(100):
|
||||||
m = self.getMsg('roulette')
|
m = self.getMsg('roulette', frm='someoneElse')
|
||||||
if m.command == 'PRIVMSG':
|
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':
|
elif m.command == 'KICK':
|
||||||
sawKick = True
|
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:
|
else:
|
||||||
self.fail('Got something other than a kick or a privmsg.')
|
self.fail('Got something other than a kick or a privmsg.')
|
||||||
self.failUnless(sawKick, 'Didn\'t get a kick in %s iterations!' % i)
|
self.failUnless(sawKick, 'Didn\'t get a kick in %s iterations!' % i)
|
||||||
|
Loading…
Reference in New Issue
Block a user