summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2011-09-19 18:24:50 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2011-09-21 19:27:13 +0100
commitc8b1014ebc4ae7ad7fed8810e5ed0a05ebd7d5d9 (patch)
treeaee63b6bcc2fcfc75708132bd73c9f33c80f34bd /tests
parent6417d165242ffeb1899108baee3d38709cc8a5e7 (diff)
tests: make sync_dbus more reliable
This is taken from Gabble.
Diffstat (limited to 'tests')
-rw-r--r--tests/twisted/servicetest.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/twisted/servicetest.py b/tests/twisted/servicetest.py
index 4ceaf64c..eef2bc90 100644
--- a/tests/twisted/servicetest.py
+++ b/tests/twisted/servicetest.py
@@ -463,9 +463,14 @@ def call_async(test, proxy, method, *args, **kw):
method_proxy(*args, **kw)
def sync_dbus(bus, q, proxy):
- # Dummy D-Bus method call
- call_async(q, dbus.Interface(proxy, dbus.PEER_IFACE), "Ping")
- event = q.expect('dbus-return', method='Ping')
+ # 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 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')
class ProxyWrapper:
def __init__(self, object, default, others):