[telepathy-mission-control/master] In tests that start up MC late, wait for it to take its bus names

Simon McVittie simon.mcvittie at collabora.co.uk
Tue May 26 05:03:56 PDT 2009


---
 test/twisted/crash-recovery/crash-recovery.py |   14 ++++++++++++++
 test/twisted/dispatcher/create-at-startup.py  |   15 +++++++++++++++
 2 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/test/twisted/crash-recovery/crash-recovery.py b/test/twisted/crash-recovery/crash-recovery.py
index e8b389c..8f308a7 100644
--- a/test/twisted/crash-recovery/crash-recovery.py
+++ b/test/twisted/crash-recovery/crash-recovery.py
@@ -76,6 +76,20 @@ def test(q, bus, unused):
 
     # service-activate MC
     mc = make_mc(bus, q.append)
+    q.expect_many(
+            EventPattern('dbus-signal',
+                path='/org/freedesktop/DBus',
+                interface='org.freedesktop.DBus', signal='NameOwnerChanged',
+                predicate=lambda e: e.args[0] == cs.AM and e.args[2]),
+            EventPattern('dbus-signal',
+                path='/org/freedesktop/DBus',
+                interface='org.freedesktop.DBus', signal='NameOwnerChanged',
+                predicate=lambda e: e.args[0] == cs.CD and e.args[2]),
+            EventPattern('dbus-signal',
+                path='/org/freedesktop/DBus',
+                interface='org.freedesktop.DBus', signal='NameOwnerChanged',
+                predicate=lambda e: e.args[0] == cs.MC and e.args[2]),
+            )
 
     # we're told about the other channel as an observer...
     e = q.expect('dbus-method-call',
diff --git a/test/twisted/dispatcher/create-at-startup.py b/test/twisted/dispatcher/create-at-startup.py
index f55241e..1875d85 100644
--- a/test/twisted/dispatcher/create-at-startup.py
+++ b/test/twisted/dispatcher/create-at-startup.py
@@ -55,6 +55,21 @@ def test(q, bus, unused):
 
     # service-activate MC and immediately make a request
     mc = make_mc(bus, q.append)
+    q.expect_many(
+            EventPattern('dbus-signal',
+                path='/org/freedesktop/DBus',
+                interface='org.freedesktop.DBus', signal='NameOwnerChanged',
+                predicate=lambda e: e.args[0] == cs.AM and e.args[2]),
+            EventPattern('dbus-signal',
+                path='/org/freedesktop/DBus',
+                interface='org.freedesktop.DBus', signal='NameOwnerChanged',
+                predicate=lambda e: e.args[0] == cs.CD and e.args[2]),
+            EventPattern('dbus-signal',
+                path='/org/freedesktop/DBus',
+                interface='org.freedesktop.DBus', signal='NameOwnerChanged',
+                predicate=lambda e: e.args[0] == cs.MC and e.args[2]),
+            )
+
     account = bus.get_object(cs.MC,
             cs.tp_path_prefix +
             '/Account/fakecm/fakeprotocol/jc_2edenton_40unatco_2eint')
-- 
1.5.6.5




More information about the telepathy-commits mailing list