[Telepathy-commits] [telepathy-gabble/master] jingle/test-outgoing-call.py: exercise ListStreams in a basic way, and make assertions about the result of RequestStreams
Simon McVittie
simon.mcvittie at collabora.co.uk
Wed Mar 11 03:05:46 PDT 2009
---
tests/twisted/jingle/test-outgoing-call.py | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/tests/twisted/jingle/test-outgoing-call.py b/tests/twisted/jingle/test-outgoing-call.py
index 15092db..ccf16ef 100644
--- a/tests/twisted/jingle/test-outgoing-call.py
+++ b/tests/twisted/jingle/test-outgoing-call.py
@@ -127,7 +127,26 @@ def test(q, bus, conn, stream):
assert 'RemotePendingMembers' in group_props, group_props
assert 'GroupFlags' in group_props, group_props
- media_iface.RequestStreams(handle, [0]) # 0 == MEDIA_STREAM_TYPE_AUDIO
+ list_streams_result = media_iface.ListStreams()
+ assert len(list_streams_result) == 0, streams
+
+ streams = media_iface.RequestStreams(handle,
+ [cs.MEDIA_STREAM_TYPE_AUDIO])
+
+ list_streams_result = media_iface.ListStreams()
+ assert streams == list_streams_result, (streams, list_streams_result)
+
+ assert len(streams) == 1, streams
+ assert len(streams[0]) == 6, streams[0]
+ # streams[0][0] is the stream identifier, which in principle we can't
+ # make any assertion about (although in practice it's probably 1)
+ assert streams[0][1] == handle, (streams[0], handle)
+ assert streams[0][2] == cs.MEDIA_STREAM_TYPE_AUDIO, streams[0]
+ # We haven't connected yet
+ assert streams[0][3] == cs.MEDIA_STREAM_STATE_DISCONNECTED, streams[0]
+ # In Gabble, requested streams start off bidirectional
+ assert streams[0][4] == cs.MEDIA_STREAM_DIRECTION_BIDIRECTIONAL, streams[0]
+ assert streams[0][5] == 0, streams[0]
# S-E gets notified about new session handler, and calls Ready on it
e = q.expect('dbus-signal', signal='NewSessionHandler')
--
1.5.6.5
More information about the telepathy-commits
mailing list