[Telepathy-commits] [telepathy-salut/master] test-text-channel.py: Wait Salut to release its well-known bus name at the end of the test
Alban Crequy
alban.crequy at collabora.co.uk
Fri Feb 6 03:14:50 PST 2009
---
tests/twisted/avahi/test-text-channel.py | 7 +++++++
tests/twisted/servicetest.py | 16 ++++++++++++++++
2 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/tests/twisted/avahi/test-text-channel.py b/tests/twisted/avahi/test-text-channel.py
index 1eaf2e8..e13d898 100644
--- a/tests/twisted/avahi/test-text-channel.py
+++ b/tests/twisted/avahi/test-text-channel.py
@@ -94,6 +94,13 @@ def test(q, bus, conn):
assert e.args[3] == TEXT_MESSAGE_TYPE_NORMAL
assert e.args[5] == OUTGOING_MESSAGE
+ conn.Disconnect()
+ #q.expect('dbus-signal', signal='StatusChanged', args=[2, 1])
+ print "go"
+ e = q.expect('dbus-name-owner-changed',
+ name='org.freedesktop.Telepathy.Connection.salut.local_xmpp.testsuite')
+ print "done"
+
if __name__ == '__main__':
exec_test(test)
diff --git a/tests/twisted/servicetest.py b/tests/twisted/servicetest.py
index 69ef0f9..579d293 100644
--- a/tests/twisted/servicetest.py
+++ b/tests/twisted/servicetest.py
@@ -430,6 +430,22 @@ def make_connection(bus, event_func, name, proto, params):
byte_arrays=True
)
+ bus.add_signal_receiver(
+ lambda *args, **kw:
+ event_func(
+ Event('dbus-name-owner-changed',
+ name=map(unwrap, args)[0],
+ old_owner=map(unwrap, args)[1],
+ new_owner=map(unwrap, args)[2])),
+ "NameOwnerChanged", # signal name
+ "org.freedesktop.DBus", #interface
+ "org.freedesktop.DBus",
+ path_keyword='path',
+ member_keyword='member',
+ interface_keyword='interface',
+ byte_arrays=True
+ )
+
return conn
def make_channel_proxy(conn, path, iface):
--
1.5.6.5
More information about the telepathy-commits
mailing list