From c07468e2756e06b4143daca57d426b176d70bc74 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sun, 7 Sep 2003 08:28:33 +0000 Subject: [PATCH] Added test to make sure .sendMsg went before .queueMsg. --- test/test_irclib.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/test_irclib.py b/test/test_irclib.py index a1b9619de..9662e27b5 100644 --- a/test/test_irclib.py +++ b/test/test_irclib.py @@ -199,7 +199,11 @@ class IrcStateTestCase(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): self.irc.feedMsg(ircmsgs.ping('123')) self.assertEqual(ircmsgs.pong('123'), self.irc.takeMsg()) @@ -210,6 +214,14 @@ class IrcTestCase(unittest.TestCase): msg = self.irc.takeMsg() 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): for msg in msgs: try: