[telepathy-gabble/master] Caps tests: explicitly do not test the initial presence

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Jul 28 14:50:31 PDT 2009


This avoids a race between D-Bus and the stream.
---
 tests/twisted/caps/advertise-draft1.py |    6 +++++-
 tests/twisted/caps/advertise-legacy.py |    6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/tests/twisted/caps/advertise-draft1.py b/tests/twisted/caps/advertise-draft1.py
index 63928c0..c4f4c16 100644
--- a/tests/twisted/caps/advertise-draft1.py
+++ b/tests/twisted/caps/advertise-draft1.py
@@ -24,7 +24,11 @@ def noop_presence_update(q, stream):
 
 def run_test(q, bus, conn, stream):
     conn.Connect()
-    q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+
+    _, initial_presence = q.expect_many(
+            EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+            EventPattern('stream-presence'),
+            )
 
     # This method call looks wrong, but it's "the other side" of
     # test/twisted/capabilities/draft-1.py in MC 5.1 - MC doesn't know
diff --git a/tests/twisted/caps/advertise-legacy.py b/tests/twisted/caps/advertise-legacy.py
index 434287e..3910567 100644
--- a/tests/twisted/caps/advertise-legacy.py
+++ b/tests/twisted/caps/advertise-legacy.py
@@ -15,7 +15,11 @@ import ns
 
 def run_test(q, bus, conn, stream):
     conn.Connect()
-    q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+
+    _, initial_presence = q.expect_many(
+            EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+            EventPattern('stream-presence'),
+            )
 
     # This method call looks wrong, but it's "the other side" of
     # test/twisted/capabilities/legacy-caps.py in MC 5.1 - MC doesn't know
-- 
1.5.6.5




More information about the telepathy-commits mailing list