[telepathy-gabble/master] Unrace offer-muc-stream-tube.py
Will Thompson
will.thompson at collabora.co.uk
Wed Jun 3 10:04:42 PDT 2009
Previously it might send the other members' presence before Gabble's
tried to join.
Reviewed-by: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
---
tests/twisted/tubes/offer-muc-stream-tube.py | 24 +++++++++---------------
1 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/tests/twisted/tubes/offer-muc-stream-tube.py b/tests/twisted/tubes/offer-muc-stream-tube.py
index bc256de..1dee574 100644
--- a/tests/twisted/tubes/offer-muc-stream-tube.py
+++ b/tests/twisted/tubes/offer-muc-stream-tube.py
@@ -10,6 +10,7 @@ from gabbletest import acknowledge_iq, make_muc_presence
import constants as cs
import ns
import tubetestutil as t
+from mucutil import join_muc
from muctubeutil import get_muc_tubes_channel
from bytestream import BytestreamS5BRelay, BytestreamS5BRelayBugged
@@ -206,21 +207,14 @@ def test(q, bus, conn, stream, bytestream_cls,
# offer a stream tube to another room (new API)
address = t.create_server(q, address_type, block_reading=True)
- call_async(q, conn.Requests, 'CreateChannel',
- {cs.CHANNEL_TYPE: cs.CHANNEL_TYPE_STREAM_TUBE,
- cs.TARGET_HANDLE_TYPE: cs.HT_ROOM,
- cs.TARGET_ID: 'chat2 at conf.localhost',
- cs.STREAM_TUBE_SERVICE: 'newecho',
- })
-
- # Send presence for other member of room.
- stream.send(make_muc_presence('owner', 'moderator', 'chat2 at conf.localhost', 'bob'))
-
- # Send presence for own membership of room.
- stream.send(make_muc_presence('none', 'participant', 'chat2 at conf.localhost', 'test'))
-
- event = q.expect('dbus-return', method='CreateChannel')
- new_tube_path, new_tube_props = event.value
+ request = {
+ cs.CHANNEL_TYPE: cs.CHANNEL_TYPE_STREAM_TUBE,
+ cs.TARGET_HANDLE_TYPE: cs.HT_ROOM,
+ cs.TARGET_ID: 'chat2 at conf.localhost',
+ cs.STREAM_TUBE_SERVICE: 'newecho',
+ }
+ _, _, new_tube_path, new_tube_props = \
+ join_muc(q, bus, conn, stream, 'chat2 at conf.localhost', request)
# first text and tubes channels are announced
event = q.expect('dbus-signal', signal='NewChannels')
--
1.5.6.5
More information about the telepathy-commits
mailing list