[telepathy-gabble/master] vcard/update-rejected.py: break race

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Thu Jul 16 07:36:47 PDT 2009


Test was relying on the ordering of the vCard IQ reply and the D-Bus
method call. Ensure that the first vCard reply has been received by
Gabble and then wait for the second vCard query once we have called the
SetAvatar method.
---
 tests/twisted/vcard/update-rejected.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/tests/twisted/vcard/update-rejected.py b/tests/twisted/vcard/update-rejected.py
index c32b310..90856fe 100644
--- a/tests/twisted/vcard/update-rejected.py
+++ b/tests/twisted/vcard/update-rejected.py
@@ -7,7 +7,7 @@ being sent over the bus.
 from twisted.words.xish import domish
 
 from servicetest import call_async
-from gabbletest import exec_test, expect_and_handle_get_vcard, send_error_reply
+from gabbletest import exec_test, expect_and_handle_get_vcard, send_error_reply, sync_stream
 
 import ns
 import constants as cs
@@ -16,9 +16,12 @@ def test(q, bus, conn, stream):
     conn.Connect()
 
     expect_and_handle_get_vcard(q, stream)
+    sync_stream(q, stream)
 
     call_async(q, conn.Avatars, 'SetAvatar', 'william shatner',
         'image/x-actor-name')
+    # Gabble request the last version of the vCard before changing it
+    expect_and_handle_get_vcard(q, stream)
 
     set_vcard_event = q.expect('stream-iq', query_ns=ns.VCARD_TEMP,
         query_name='vCard', iq_type='set')
-- 
1.5.6.5



More information about the telepathy-commits mailing list