[Telepathy-commits] [telepathy-gabble/master] offer-muc-stream-tube-ibb.py: check if tube created using the old API are announced on the new API
Guillaume Desmottes
guillaume.desmottes at collabora.co.uk
Mon Jan 19 07:22:49 PST 2009
---
tests/twisted/tubes/offer-muc-stream-tube-ibb.py | 24 ++++++++++++++++++++-
1 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/tests/twisted/tubes/offer-muc-stream-tube-ibb.py b/tests/twisted/tubes/offer-muc-stream-tube-ibb.py
index fd7f3cc..37f8a0d 100644
--- a/tests/twisted/tubes/offer-muc-stream-tube-ibb.py
+++ b/tests/twisted/tubes/offer-muc-stream-tube-ibb.py
@@ -142,10 +142,11 @@ def test(q, bus, conn, stream):
call_async(q, tubes_iface, 'OfferStreamTube',
'echo', sample_parameters, 0, dbus.ByteArray(srv_path), 0, "")
- new_tube_event, stream_event, _ = q.expect_many(
+ new_tube_event, stream_event, _, new_channels_event = q.expect_many(
EventPattern('dbus-signal', signal='NewTube'),
EventPattern('stream-presence', to='chat at conf.localhost/test'),
- EventPattern('dbus-return', method='OfferStreamTube'))
+ EventPattern('dbus-return', method='OfferStreamTube'),
+ EventPattern('dbus-signal', signal='NewChannels'))
# handle new_tube_event
stream_tube_id = new_tube_event.args[0]
@@ -190,6 +191,25 @@ def test(q, bus, conn, stream):
'u': ('uint', '123'),
}
+ # tube is also announced using new API
+ channels = new_channels_event.args[0]
+ assert len(channels) == 1
+ path, props = channels[0]
+ assert props[CHANNEL_TYPE] == CHANNEL_TYPE_STREAM_TUBE
+ assert props[INITIATOR_HANDLE] == tubes_self_handle
+ assert props[INITIATOR_ID] == 'chat at conf.localhost/test'
+ assert props[INTERFACES] == [CHANNEL_IFACE_GROUP, CHANNEL_IFACE_TUBE]
+ assert props[REQUESTED] == True
+ assert props[TARGET_HANDLE] == chat_handle
+ assert props[TARGET_ID] == 'chat at conf.localhost'
+ assert props[STREAM_TUBE_SERVICE] == 'echo'
+
+ tube_chan = bus.get_object(conn.bus_name, path)
+ tube_props = tube_chan.GetAll(CHANNEL_IFACE_TUBE, dbus_interface=PROPERTIES_IFACE,
+ byte_arrays=True)
+ assert tube_props['Parameters'] == sample_parameters
+ assert tube_props['Status'] == TUBE_CHANNEL_STATE_OPEN
+
tubes = tubes_iface.ListTubes(byte_arrays=True)
assert tubes == [(
stream_tube_id,
--
1.5.6.5
More information about the Telepathy-commits
mailing list