[Telepathy-commits] [telepathy-idle/master] message-order test: use loop to make this a bit cleaner

Jonathon Jongsma jonathon.jongsma at collabora.co.uk
Tue Feb 17 08:53:27 PST 2009


---
 tests/twisted/messages/message-order.py |   20 ++++++++------------
 1 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/tests/twisted/messages/message-order.py b/tests/twisted/messages/message-order.py
index b2259ca..39bfe7c 100644
--- a/tests/twisted/messages/message-order.py
+++ b/tests/twisted/messages/message-order.py
@@ -22,18 +22,14 @@ def test(q, bus, conn, stream):
 
     text_chan = dbus.Interface(chan,
         u'org.freedesktop.Telepathy.Channel.Type.Text')
-    # send a whole bunch of messages in a row
-    call_async(q, text_chan, 'Send', 0, '0')
-    call_async(q, text_chan, 'Send', 0, '1')
-    call_async(q, text_chan, 'Send', 0, '2')
-    call_async(q, text_chan, 'Send', 0, '3')
-    call_async(q, text_chan, 'Send', 0, '4')
-
-    q.expect('irc-privmsg', data={'message':'0','recipient':CHANNEL_NAME})
-    q.expect('irc-privmsg', data={'message':'1','recipient':CHANNEL_NAME})
-    q.expect('irc-privmsg', data={'message':'2','recipient':CHANNEL_NAME})
-    q.expect('irc-privmsg', data={'message':'3','recipient':CHANNEL_NAME})
-    q.expect('irc-privmsg', data={'message':'4','recipient':CHANNEL_NAME})
+
+    # send a whole bunch of messages in a row and make sure they get delivered
+    # in the proper order
+    for i in range(4):
+        call_async(q, text_chan, 'Send', 0, str(i))
+
+    for i in range(4):
+        q.expect('irc-privmsg', data={'message':str(i),'recipient':CHANNEL_NAME})
 
     call_async(q, conn, 'Disconnect')
     return True
-- 
1.5.6.5




More information about the telepathy-commits mailing list