[Telepathy-commits] [telepathy-gabble/master] test-desc-info: expect the 'normal' SetRemoteCodecs
Will Thompson
will.thompson at collabora.co.uk
Thu Feb 26 16:02:10 PST 2009
This fixes a race where assertions that we intended to make about the
SetRemoteCodecs caused by the other side sending description-info ended
up being made about the unmodified codecs.
---
tests/twisted/jingle/test-description-info.py | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/tests/twisted/jingle/test-description-info.py b/tests/twisted/jingle/test-description-info.py
index c9f965d..e75e1d0 100644
--- a/tests/twisted/jingle/test-description-info.py
+++ b/tests/twisted/jingle/test-description-info.py
@@ -84,11 +84,19 @@ def test(q, bus, conn, stream):
stream_handler.Ready(jt2.get_audio_codecs_dbus())
stream_handler.StreamState(2)
- # First one is transport-info
- e = q.expect('stream-iq')
+ # First IQ is transport-info; also, we expect to be told what codecs the
+ # other end wants.
+ e, src = q.expect_many(
+ EventPattern('stream-iq'),
+ EventPattern('dbus-signal', signal='SetRemoteCodecs')
+ )
assert jp.match_jingle_action(e.query, 'transport-info')
assert e.query['initiator'] == 'foo at bar.com/Foo'
+ assert jt2.audio_codecs == [ (name, id, rate)
+ for id, name, type, rate, channels, parameters in unwrap(src.args[0]) ], \
+ (jt2.audio_codecs, unwrap(src.args[0]))
+
stream.send(jp.xml(jp.ResultIq('test at localhost', e.stanza, [])))
# S-E reports codec intersection, after which gabble can send acceptance
@@ -118,7 +126,8 @@ def test(q, bus, conn, stream):
e = q.expect('dbus-signal', signal='SetRemoteCodecs')
assert jt2.audio_codecs == [ (name, id, rate)
- for id, name, type, rate, channels, parameters in unwrap(e.args[0]) ]
+ for id, name, type, rate, channels, parameters in unwrap(e.args[0]) ], \
+ (jt2.audio_codecs, unwrap(e.args[0]))
# We close the session by removing the stream
media_iface.RemoveStreams([id1])
--
1.5.6.5
More information about the telepathy-commits
mailing list