mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-10-20 02:47:26 +02:00
Added test to make sure .sendMsg went before .queueMsg.
This commit is contained in:
parent
4ca8f91fa9
commit
c07468e275
@ -199,7 +199,11 @@ class IrcStateTestCase(unittest.TestCase):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
class IrcTestCase(unittest.TestCase):
|
class IrcTestCase(unittest.TestCase):
|
||||||
irc = irclib.Irc('nick')
|
def setUp(self):
|
||||||
|
self.irc = irclib.Irc('nick')
|
||||||
|
_ = self.irc.takeMsg() # NICK
|
||||||
|
_ = self.irc.takeMsg() # USER
|
||||||
|
|
||||||
def testPingResponse(self):
|
def testPingResponse(self):
|
||||||
self.irc.feedMsg(ircmsgs.ping('123'))
|
self.irc.feedMsg(ircmsgs.ping('123'))
|
||||||
self.assertEqual(ircmsgs.pong('123'), self.irc.takeMsg())
|
self.assertEqual(ircmsgs.pong('123'), self.irc.takeMsg())
|
||||||
@ -210,6 +214,14 @@ class IrcTestCase(unittest.TestCase):
|
|||||||
msg = self.irc.takeMsg()
|
msg = self.irc.takeMsg()
|
||||||
self.failUnless(msg.command == 'NICK' and msg.args[0] != self.irc.nick)
|
self.failUnless(msg.command == 'NICK' and msg.args[0] != self.irc.nick)
|
||||||
|
|
||||||
|
def testSendBeforeQueue(self):
|
||||||
|
self.irc.queueMsg(ircmsgs.IrcMsg('NOTICE #foo bar'))
|
||||||
|
self.irc.sendMsg(ircmsgs.IrcMsg('PRIVMSG #foo yeah!'))
|
||||||
|
msg = self.irc.takeMsg()
|
||||||
|
self.failUnless(msg.command == 'PRIVMSG')
|
||||||
|
msg = self.irc.takeMsg()
|
||||||
|
self.failUnless(msg.command == 'NOTICE')
|
||||||
|
|
||||||
def testReset(self):
|
def testReset(self):
|
||||||
for msg in msgs:
|
for msg in msgs:
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user