Misc: Fix testTell.

This commit is contained in:
Valentin Lorentz 2013-01-04 22:01:36 +01:00
parent 28dc3dd3ac
commit e86768b61a
2 changed files with 4 additions and 1 deletions

View File

@ -141,11 +141,14 @@ class MiscTestCase(ChannelPluginTestCase):
def testTell(self):
# This test fails because the test is seeing us as owner and Misc.tell
# allows the owner to send messages to people the bot hasn't seen.
oldprefix, self.prefix = self.prefix, 'tester!foo@bar__no_testcap__baz'
self.nick = 'tester'
m = self.getMsg('tell aljsdkfh [plugin tell]')
self.failUnless('let you do' in m.args[1])
m = self.getMsg('tell #foo [plugin tell]')
self.failUnless('No need for' in m.args[1])
m = self.getMsg('tell me you love me')
m = self.irc.takeMsg()
self.failUnless(m.args[0] == self.nick)
def testNoNestedTell(self):

View File

@ -1046,7 +1046,7 @@ def checkCapability(hostmask, capability, users=users, channels=channels,
ignoreOwner=False):
"""Checks that the user specified by name/hostmask has the capability given.
"""
if world.testing:
if world.testing and '__no_testcap__' not in hostmask.split('@')[1]:
return _x(capability, True)
try:
u = users.getUser(hostmask)