mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Made PRIVMSG and NOTICE low-priority so TOPIC would happen before them.
This commit is contained in:
parent
c45e38b537
commit
3eb86b8869
@ -123,7 +123,7 @@ class IrcMsgQueue(object):
|
|||||||
self.msgs.add(msg)
|
self.msgs.add(msg)
|
||||||
if msg.command in ('MODE', 'KICK', 'PONG'):
|
if msg.command in ('MODE', 'KICK', 'PONG'):
|
||||||
self.highpriority.enqueue(msg)
|
self.highpriority.enqueue(msg)
|
||||||
elif msg.command in ('PING', 'WHO'):
|
elif msg.command in ('PRIVMSG', 'PING', 'WHO', 'NOTICE'):
|
||||||
self.lowpriority.enqueue(msg)
|
self.lowpriority.enqueue(msg)
|
||||||
else:
|
else:
|
||||||
self.normal.enqueue(msg)
|
self.normal.enqueue(msg)
|
||||||
|
@ -45,6 +45,7 @@ class IrcMsgQueueTestCase(unittest.TestCase):
|
|||||||
kick = ircmsgs.kick('#foo', 'PeterB')
|
kick = ircmsgs.kick('#foo', 'PeterB')
|
||||||
pong = ircmsgs.pong('123')
|
pong = ircmsgs.pong('123')
|
||||||
ping = ircmsgs.ping('123')
|
ping = ircmsgs.ping('123')
|
||||||
|
topic = ircmsgs.topic('#foo')
|
||||||
notice = ircmsgs.notice('jemfinch', 'supybot here')
|
notice = ircmsgs.notice('jemfinch', 'supybot here')
|
||||||
join = ircmsgs.join('#foo')
|
join = ircmsgs.join('#foo')
|
||||||
who = ircmsgs.who('#foo')
|
who = ircmsgs.who('#foo')
|
||||||
@ -77,10 +78,7 @@ class IrcMsgQueueTestCase(unittest.TestCase):
|
|||||||
q.enqueue(self.msg)
|
q.enqueue(self.msg)
|
||||||
q.enqueue(self.kick)
|
q.enqueue(self.kick)
|
||||||
self.assertEqual(self.kick, q.dequeue())
|
self.assertEqual(self.kick, q.dequeue())
|
||||||
q.enqueue(self.ping)
|
|
||||||
q.enqueue(self.msg)
|
|
||||||
self.assertEqual(self.msg, q.dequeue())
|
self.assertEqual(self.msg, q.dequeue())
|
||||||
self.assertEqual(self.ping, q.dequeue())
|
|
||||||
q.enqueue(self.ping)
|
q.enqueue(self.ping)
|
||||||
q.enqueue(self.msgs[0])
|
q.enqueue(self.msgs[0])
|
||||||
q.enqueue(self.kick)
|
q.enqueue(self.kick)
|
||||||
@ -88,9 +86,9 @@ class IrcMsgQueueTestCase(unittest.TestCase):
|
|||||||
q.enqueue(self.mode)
|
q.enqueue(self.mode)
|
||||||
self.assertEqual(self.kick, q.dequeue())
|
self.assertEqual(self.kick, q.dequeue())
|
||||||
self.assertEqual(self.mode, q.dequeue())
|
self.assertEqual(self.mode, q.dequeue())
|
||||||
|
self.assertEqual(self.ping, q.dequeue())
|
||||||
self.assertEqual(self.msgs[0], q.dequeue())
|
self.assertEqual(self.msgs[0], q.dequeue())
|
||||||
self.assertEqual(self.msgs[1], q.dequeue())
|
self.assertEqual(self.msgs[1], q.dequeue())
|
||||||
self.assertEqual(self.ping, q.dequeue())
|
|
||||||
|
|
||||||
def testNoIdenticals(self):
|
def testNoIdenticals(self):
|
||||||
q = irclib.IrcMsgQueue()
|
q = irclib.IrcMsgQueue()
|
||||||
@ -110,6 +108,13 @@ class IrcMsgQueueTestCase(unittest.TestCase):
|
|||||||
self.assertEqual(self.join, q.dequeue())
|
self.assertEqual(self.join, q.dequeue())
|
||||||
self.assertEqual(self.who, q.dequeue())
|
self.assertEqual(self.who, q.dequeue())
|
||||||
|
|
||||||
|
def testTopicBeforePrivmsg(self):
|
||||||
|
q = irclib.IrcMsgQueue()
|
||||||
|
q.enqueue(self.msg)
|
||||||
|
q.enqueue(self.topic)
|
||||||
|
self.assertEqual(self.topic, q.dequeue())
|
||||||
|
self.assertEqual(self.msg, q.dequeue())
|
||||||
|
|
||||||
|
|
||||||
class ChannelTestCase(unittest.TestCase):
|
class ChannelTestCase(unittest.TestCase):
|
||||||
def testPickleCopy(self):
|
def testPickleCopy(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user