From ff6d204ea918856bdd86e3df841b9b4e1180f1a5 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 25 Sep 2013 17:13:28 +0100 Subject: [PATCH 4/4] servicetest: simplify sync_dbus() to the version from MC --- tests/twisted/servicetest.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/twisted/servicetest.py b/tests/twisted/servicetest.py index b25fe42..c464d8f 100644 --- a/tests/twisted/servicetest.py +++ b/tests/twisted/servicetest.py @@ -569,17 +569,13 @@ def call_async(test, proxy, method, *args, **kw): kw.update({'reply_handler': reply_func, 'error_handler': error_func}) method_proxy(*args, **kw) -def sync_dbus(bus, q, conn): +def sync_dbus(bus, q, proxy): # Dummy D-Bus method call. We can't use DBus.Peer.Ping() because libdbus # replies to that message immediately, rather than handing it up to - # dbus-glib and thence Gabble, which means that Ping()ing Gabble doesn't - # ensure that it's processed all D-Bus messages prior to our ping. - # - # This won't do the right thing unless the proxy has a unique name. - assert conn.object.bus_name.startswith(':') - root_object = bus.get_object(conn.object.bus_name, '/', introspect=False) - call_async(q, - dbus.Interface(root_object, cs.PREFIX + '.Tests'), + # dbus-glib and thence the application, which means that Ping()ing the + # application doesn't ensure that it's processed all D-Bus messages prior + # to our ping. + call_async(q, dbus.Interface(proxy, 'org.freedesktop.Telepathy.Tests'), 'DummySyncDBus') q.expect('dbus-error', method='DummySyncDBus') -- 1.8.4.rc3