telepathy-gabble: jingle/payload-types: use jingletest2

Will Thompson wjt at kemper.freedesktop.org
Thu Dec 6 04:46:05 PST 2012


Module: telepathy-gabble
Branch: master
Commit: d31e229e8bdc3dad3e7d98bf291c103cb4948c8f
URL:    http://cgit.freedesktop.org/telepathy/telepathy-gabble/commit/?id=d31e229e8bdc3dad3e7d98bf291c103cb4948c8f

Author: Will Thompson <will.thompson at collabora.co.uk>
Date:   Mon Nov 26 09:10:39 2012 +0000

jingle/payload-types: use jingletest2

---

 tests/twisted/jingle/payload-types.py |   25 +++++++++----------------
 1 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/tests/twisted/jingle/payload-types.py b/tests/twisted/jingle/payload-types.py
index cdc0979..64a300f 100644
--- a/tests/twisted/jingle/payload-types.py
+++ b/tests/twisted/jingle/payload-types.py
@@ -4,9 +4,9 @@ Regression test for https://bugs.freedesktop.org/show_bug.cgi?id=18918
 
 import dbus
 
-from gabbletest import exec_test, sync_stream
+from gabbletest import exec_test
 from servicetest import wrap_channel, make_channel_proxy
-import jingletest
+import jingletest2
 import constants as cs
 
 from config import VOIP_ENABLED
@@ -16,23 +16,15 @@ if not VOIP_ENABLED:
     raise SystemExit(77)
 
 def test(q, bus, conn, stream):
-    jt = jingletest.JingleTest(stream, 'test at localhost', 'foo at bar.com/Foo')
+    jp = jingletest2.JingleProtocol031()
+    jt = jingletest2.JingleTest2(jp, conn, q, stream, 'test at localhost',
+        'foo at bar.com/Foo')
 
     self_handle = conn.GetSelfHandle()
 
-    # We need remote end's presence for capabilities
-    jt.send_remote_presence()
+    jt.send_presence_and_caps()
 
-    # Gabble doesn't trust it, so makes a disco
-    event = q.expect('stream-iq', query_ns='http://jabber.org/protocol/disco#info',
-             to='foo at bar.com/Foo')
-
-    jt.send_remote_disco_reply(event.stanza)
-
-    # Force Gabble to process the caps before calling RequestChannel
-    sync_stream(q, stream)
-
-    handle = conn.RequestHandles(cs.HT_CONTACT, [jt.remote_jid])[0]
+    handle = conn.RequestHandles(cs.HT_CONTACT, [jt.peer])[0]
     path = conn.RequestChannel(
         cs.CHANNEL_TYPE_STREAMED_MEDIA, cs.HT_CONTACT, handle, True)
 
@@ -91,7 +83,8 @@ def test(q, bus, conn, stream):
     # Test that codec parameters are correctly extracted from <parameter>
     # children of <payload-type> rather than from attributes of the latter.
 
-    jt.incoming_call({'misc': 'other'})
+    jt.audio_codecs = [ ('GSM', 3, 8000, {'misc': 'other'}) ]
+    jt.incoming_call()
 
     e = q.expect('dbus-signal', signal='NewSessionHandler')
     assert e.args[1] == 'rtp'



More information about the telepathy-commits mailing list