[Telepathy-commits] [telepathy-gabble/master] offer-muc-dbus-tube: check if DBusNamesChanged is fired when a contact leave the tube

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Wed Feb 4 05:24:19 PST 2009


---
 tests/twisted/tubes/offer-muc-dbus-tube.py |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/tests/twisted/tubes/offer-muc-dbus-tube.py b/tests/twisted/tubes/offer-muc-dbus-tube.py
index c8543fc..9becdc4 100644
--- a/tests/twisted/tubes/offer-muc-dbus-tube.py
+++ b/tests/twisted/tubes/offer-muc-dbus-tube.py
@@ -345,7 +345,18 @@ def test(q, bus, conn, stream):
     tube = Connection(dbus_tube_adr)
     fire_signal_on_tube(q, tube, 'chat2 at conf.localhost', dbus_stream_id, my_bus_name)
 
-    # TODO: remove bob
+    # Bob leave the tube
+    presence = elem('presence', from_='chat2 at conf.localhost/bob', to='chat2 at conf.localhost')(
+        elem('x', xmlns=ns.MUC),
+        elem('tubes', xmlns=ns.TUBES))
+    stream.send(presence)
+
+    dbus_changed_event = q.expect('dbus-signal', signal='DBusNamesChanged',
+        interface=CHANNEL_TYPE_DBUS_TUBE)
+
+    added, removed = dbus_changed_event.args
+    assert added == {}
+    assert removed == [bob_handle]
 
     chan_iface.Close()
     q.expect_many(
-- 
1.5.6.5




More information about the telepathy-commits mailing list