[Telepathy-commits] [telepathy-gabble/master] get_muc_tubes_channel: return the room handle instead of an array containing only it
Guillaume Desmottes
guillaume.desmottes at collabora.co.uk
Thu Mar 12 07:45:55 PDT 2009
---
tests/twisted/tubes/muc-presence.py | 2 +-
tests/twisted/tubes/muctubeutil.py | 9 +++++----
tests/twisted/tubes/offer-muc-dbus-tube.py | 6 +++---
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/tests/twisted/tubes/muc-presence.py b/tests/twisted/tubes/muc-presence.py
index a8713c4..9bc6336 100644
--- a/tests/twisted/tubes/muc-presence.py
+++ b/tests/twisted/tubes/muc-presence.py
@@ -13,7 +13,7 @@ def test(q, bus, conn, stream):
_ = q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
- handles, tubes_chan, tubes_iface = get_muc_tubes_channel(q, bus, conn,
+ handle, tubes_chan, tubes_iface = get_muc_tubes_channel(q, bus, conn,
stream, 'chat at conf.localhost')
conn.Presence.SetStatus({'away':{'message':'Christmas lunch!'}})
diff --git a/tests/twisted/tubes/muctubeutil.py b/tests/twisted/tubes/muctubeutil.py
index 9a6af71..21026ab 100644
--- a/tests/twisted/tubes/muctubeutil.py
+++ b/tests/twisted/tubes/muctubeutil.py
@@ -29,10 +29,11 @@ def get_muc_tubes_channel(q, bus, conn, stream, muc_jid):
event = q.expect('dbus-return', method='RequestHandles')
handles = event.value[0]
+ room_handle = handles[0]
# request tubes channel
call_async(q, conn, 'RequestChannel',
- tp_name_prefix + '.Channel.Type.Tubes', cs.HT_ROOM, handles[0], True)
+ tp_name_prefix + '.Channel.Type.Tubes', cs.HT_ROOM, room_handle, True)
_, stream_event = q.expect_many(
EventPattern('dbus-signal', signal='MembersChanged',
@@ -68,7 +69,7 @@ def get_muc_tubes_channel(q, bus, conn, stream, muc_jid):
if type == cs.CHANNEL_TYPE_TEXT:
# check text channel properties
- assert props[cs.TARGET_HANDLE] == handles[0]
+ assert props[cs.TARGET_HANDLE] == room_handle
assert props[cs.TARGET_HANDLE_TYPE] == cs.HT_ROOM
assert props[cs.TARGET_ID] == 'chat at conf.localhost'
assert props[cs.REQUESTED] == False
@@ -77,7 +78,7 @@ def get_muc_tubes_channel(q, bus, conn, stream, muc_jid):
elif type == cs.CHANNEL_TYPE_TUBES:
# check tubes channel properties
assert props[cs.TARGET_HANDLE_TYPE] == cs.HT_ROOM
- assert props[cs.TARGET_HANDLE] == handles[0]
+ assert props[cs.TARGET_HANDLE] == room_handle
assert props[cs.TARGET_ID] == 'chat at conf.localhost'
assert props[cs.REQUESTED] == True
assert props[cs.INITIATOR_HANDLE] == self_handle
@@ -89,4 +90,4 @@ def get_muc_tubes_channel(q, bus, conn, stream, muc_jid):
tubes_iface = dbus.Interface(tubes_chan,
tp_name_prefix + '.Channel.Type.Tubes')
- return (handles, tubes_chan, tubes_iface)
+ return (room_handle, tubes_chan, tubes_iface)
diff --git a/tests/twisted/tubes/offer-muc-dbus-tube.py b/tests/twisted/tubes/offer-muc-dbus-tube.py
index 890ce3c..a60f7cb 100644
--- a/tests/twisted/tubes/offer-muc-dbus-tube.py
+++ b/tests/twisted/tubes/offer-muc-dbus-tube.py
@@ -103,14 +103,14 @@ def test(q, bus, conn, stream):
self_handle = conn.GetSelfHandle()
self_name = conn.InspectHandles(1, [self_handle])[0]
- handles, tubes_chan, tubes_iface = get_muc_tubes_channel(q, bus, conn,
+ handle, tubes_chan, tubes_iface = get_muc_tubes_channel(q, bus, conn,
stream, 'chat at conf.localhost')
# Exercise basic Channel Properties from spec 0.17.7
channel_props = tubes_chan.GetAll(CHANNEL,
dbus_interface=dbus.PROPERTIES_IFACE)
- assert channel_props.get('TargetHandle') == handles[0],\
- (channel_props.get('TargetHandle'), handles[0])
+ assert channel_props.get('TargetHandle') == handle,\
+ (channel_props.get('TargetHandle'), handle)
assert channel_props.get('TargetHandleType') == 2,\
channel_props.get('TargetHandleType')
assert channel_props.get('ChannelType') == CHANNEL_TYPE_TUBES,\
--
1.5.6.5
More information about the telepathy-commits
mailing list