mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 20:59:27 +01:00
Add testReplyInstant
I'm going to mess with instant replies to add support for multiline, so it's good to have a safety net.
This commit is contained in:
parent
4aca6e3d5a
commit
f98542e884
@ -534,6 +534,35 @@ class PrivmsgTestCase(ChannelPluginTestCase):
|
|||||||
self.assertRegexp('help first firstcmd', 'First', 0) # no re.I flag.
|
self.assertRegexp('help first firstcmd', 'First', 0) # no re.I flag.
|
||||||
self.assertRegexp('help firstrepeat firstcmd', 'FirstRepeat', 0)
|
self.assertRegexp('help firstrepeat firstcmd', 'FirstRepeat', 0)
|
||||||
|
|
||||||
|
def testReplyInstant(self):
|
||||||
|
self.assertNoResponse(' ')
|
||||||
|
print(conf.supybot.reply.mores.instant())
|
||||||
|
self.assertResponse(
|
||||||
|
"eval 'foo '*300",
|
||||||
|
"'" + "foo " * 110 + " \x02(2 more messages)\x02")
|
||||||
|
self.assertNoResponse(' ')
|
||||||
|
|
||||||
|
with conf.supybot.reply.mores.instant.context(2):
|
||||||
|
self.assertResponse(
|
||||||
|
"eval 'foo '*300",
|
||||||
|
"'" + "foo " * 110 + " \x02(2 more messages)\x02")
|
||||||
|
self.assertResponse(
|
||||||
|
" ",
|
||||||
|
"foo " * 111 + "\x02(1 more message)\x02")
|
||||||
|
self.assertNoResponse(" ")
|
||||||
|
|
||||||
|
with conf.supybot.reply.mores.instant.context(3):
|
||||||
|
self.assertResponse(
|
||||||
|
"eval 'foo '*300",
|
||||||
|
"'" + "foo " * 110 + " \x02(2 more messages)\x02")
|
||||||
|
self.assertResponse(
|
||||||
|
" ",
|
||||||
|
"foo " * 111 + "\x02(1 more message)\x02")
|
||||||
|
self.assertResponse(
|
||||||
|
" ",
|
||||||
|
" " + "foo " * 79 + "'")
|
||||||
|
self.assertNoResponse(" ")
|
||||||
|
|
||||||
def testClientTagReply(self):
|
def testClientTagReply(self):
|
||||||
self.irc.addCallback(self.First(self.irc))
|
self.irc.addCallback(self.First(self.irc))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user