[telepathy-gabble/master] offer-muc-stream-tube: use the new API tube too

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Wed Apr 22 08:40:13 PDT 2009


---
 tests/twisted/tubes/offer-muc-stream-tube.py |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/tests/twisted/tubes/offer-muc-stream-tube.py b/tests/twisted/tubes/offer-muc-stream-tube.py
index fed3c5d..211adff 100644
--- a/tests/twisted/tubes/offer-muc-stream-tube.py
+++ b/tests/twisted/tubes/offer-muc-stream-tube.py
@@ -322,6 +322,27 @@ def test(q, bus, conn, stream, bytestream_cls):
         params[node['name']] = (node['type'], str(node))
     assert params == {'foo': ('str', 'bar')}
 
+    bob_handle = conn.RequestHandles(cs.HT_CONTACT, ['chat2 at conf.localhost/bob'])[0]
+
+    bytestream = connect_to_tube(stream, q, bytestream_cls, 'chat2 at conf.localhost', stream_tube_id)
+
+    iq_event, socket_event, conn_event = q.expect_many(
+        EventPattern('stream-iq', iq_type='result'),
+        EventPattern('socket-connected'),
+        EventPattern('dbus-signal', signal='StreamTubeNewConnection',
+            interface=cs.CHANNEL_TYPE_STREAM_TUBE))
+
+    assert conn_event.args == [bob_handle]
+
+    protocol = socket_event.protocol
+
+    # handle iq_event
+    bytestream.check_si_reply(iq_event.stanza)
+    tube = xpath.queryForNodes('/iq//si/tube[@xmlns="%s"]' % ns.TUBES, iq_event.stanza)
+    assert len(tube) == 1
+
+    use_tube(q, bytestream, protocol)
+
     chan_iface.Close()
     q.expect_many(
         EventPattern('dbus-signal', signal='Closed'),
-- 
1.5.6.5



More information about the telepathy-commits mailing list