[Telepathy-commits] [telepathy-gabble/master] Test that C.T.DBusTube.OfferDT => NewTube and an IQ

Will Thompson will.thompson at collabora.co.uk
Tue Feb 3 03:37:15 PST 2009


---
 tests/twisted/tubes/offer-private-dbus-tube-ibb.py |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/tests/twisted/tubes/offer-private-dbus-tube-ibb.py b/tests/twisted/tubes/offer-private-dbus-tube-ibb.py
index 7f85dd7..b000c0e 100644
--- a/tests/twisted/tubes/offer-private-dbus-tube-ibb.py
+++ b/tests/twisted/tubes/offer-private-dbus-tube-ibb.py
@@ -305,10 +305,18 @@ def offer_new_dbus_tube(q, bus, conn, stream, self_handle, alice_handle):
 
     tube_chan = bus.get_object(conn.bus_name, tube_path)
     tube_chan_iface = dbus.Interface(tube_chan, tp_name_prefix + '.Channel')
+    dbus_tube_iface = dbus.Interface(tube_chan, CHANNEL_TYPE_DBUS_TUBE)
 
-    props = tube_chan.GetAll(
-        tp_name_prefix + '.Channel.Interface.Tube.DRAFT',
-        dbus_interface='org.freedesktop.DBus.Properties')
+    # Only when we offer the tube should it appear on the Tubes channel and an
+    # IQ be sent to Alice. We sync the stream to ensure the IQ would have
+    # arrived if it had been sent.
+    sync_stream(q, stream)
+    call_async(q, dbus_tube_iface, 'OfferDBusTube')
+    q.expect_many(
+        EventPattern('dbus-return', method='OfferDBusTube'),
+        EventPattern('stream-iq', to='alice at localhost/Test'),
+        EventPattern('dbus-signal', signal='NewTube'),
+        )
 
     # OK, we're done
     conn.Disconnect()
-- 
1.5.6.5




More information about the telepathy-commits mailing list