mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 19:22:45 +01:00
Fix for bug #899271, as well as some other problems with the test suite and ChannelPluginTestCase.
This commit is contained in:
parent
dcf7d167eb
commit
faa27d573f
@ -540,7 +540,7 @@ class IrcObjectProxy(RichReplyMethods):
|
|||||||
self.notice = notice or self.notice
|
self.notice = notice or self.notice
|
||||||
self.private = private or self.private
|
self.private = private or self.private
|
||||||
self.to = to or self.to
|
self.to = to or self.to
|
||||||
self.prefixName = prefixName or self.prefixName
|
self.prefixName = prefixName and self.prefixName
|
||||||
self.noLengthCheck = noLengthCheck or self.noLengthCheck
|
self.noLengthCheck = noLengthCheck or self.noLengthCheck
|
||||||
if self.finalEvaled:
|
if self.finalEvaled:
|
||||||
if isinstance(self.irc, self.__class__):
|
if isinstance(self.irc, self.__class__):
|
||||||
|
@ -219,14 +219,29 @@ class PrivmsgTestCase(ChannelPluginTestCase):
|
|||||||
self.assertResponse("eval irc.reply('foo', action=True)",
|
self.assertResponse("eval irc.reply('foo', action=True)",
|
||||||
'\x01ACTION foo\x01')
|
'\x01ACTION foo\x01')
|
||||||
|
|
||||||
|
def testReplyWithNickPrefix(self):
|
||||||
|
self.feedMsg('@strlen foo')
|
||||||
|
m = self.irc.takeMsg()
|
||||||
|
self.failUnless(m is not None, 'm: %r' % m)
|
||||||
|
self.failUnless(m.args[1].startswith(self.nick))
|
||||||
|
try:
|
||||||
|
original = conf.supybot.reply.withNickPrefix()
|
||||||
|
conf.supybot.reply.withNickPrefix.setValue(False)
|
||||||
|
self.feedMsg('@strlen foobar')
|
||||||
|
m = self.irc.takeMsg()
|
||||||
|
self.failUnless(m is not None)
|
||||||
|
self.failIf(m.args[1].startswith(self.nick))
|
||||||
|
finally:
|
||||||
|
conf.supybot.reply.withNickPrefix.setValue(original)
|
||||||
|
|
||||||
def testErrorPrivateKwarg(self):
|
def testErrorPrivateKwarg(self):
|
||||||
try:
|
try:
|
||||||
original = str(conf.supybot.reply.errorInPrivate)
|
original = conf.supybot.reply.errorInPrivate()
|
||||||
conf.supybot.reply.errorInPrivate.set('False')
|
conf.supybot.reply.errorInPrivate.set('False')
|
||||||
m = self.getMsg("eval irc.error('foo', private=True)")
|
m = self.getMsg("eval irc.error('foo', private=True)")
|
||||||
self.failIf(ircutils.isChannel(m.args[0]))
|
self.failIf(ircutils.isChannel(m.args[0]))
|
||||||
finally:
|
finally:
|
||||||
conf.supybot.reply.errorInPrivate.set(original)
|
conf.supybot.reply.errorInPrivate.setValue(original)
|
||||||
|
|
||||||
def testErrorReplyPrivate(self):
|
def testErrorReplyPrivate(self):
|
||||||
try:
|
try:
|
||||||
|
@ -306,6 +306,10 @@ class ChannelPluginTestCase(PluginTestCase):
|
|||||||
return
|
return
|
||||||
PluginTestCase.setUp(self)
|
PluginTestCase.setUp(self)
|
||||||
self.irc.feedMsg(ircmsgs.join(self.channel, prefix=self.prefix))
|
self.irc.feedMsg(ircmsgs.join(self.channel, prefix=self.prefix))
|
||||||
|
m = self.irc.takeMsg()
|
||||||
|
self.assertEqual(m.command, 'MODE')
|
||||||
|
m = self.irc.takeMsg()
|
||||||
|
self.assertEqual(m.command, 'WHO')
|
||||||
|
|
||||||
def _feedMsg(self, query, timeout=None, to=None, frm=None):
|
def _feedMsg(self, query, timeout=None, to=None, frm=None):
|
||||||
if to is None:
|
if to is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user