[Telepathy-commits] [telepathy-gabble/master] Extract building huge codec tuple in tests

Will Thompson will.thompson at collabora.co.uk
Thu Feb 26 17:16:33 PST 2009


In passing, change the number of supported channels it uses from 0 to 1.
---
 tests/twisted/jingle/jingletest2.py |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/tests/twisted/jingle/jingletest2.py b/tests/twisted/jingle/jingletest2.py
index c129d75..efad283 100644
--- a/tests/twisted/jingle/jingletest2.py
+++ b/tests/twisted/jingle/jingletest2.py
@@ -305,15 +305,16 @@ class JingleTest2:
         # Force Gabble to process the caps before doing any more Jingling
         sync_stream(self.q, self.stream)
 
+    def dbusify_codecs(self, codecs):
+        dbussed_codecs = [ (id, name, 0, rate, 1, {} )
+                            for (name, id, rate) in codecs ]
+        return dbus.Array(dbussed_codecs, signature='(usuuua{ss})')
+
     def get_audio_codecs_dbus(self):
-        codecs = [ (id, name, 0, rate, 0, {} )
-                   for (name, id, rate) in self.audio_codecs ]
-        return dbus.Array(codecs, signature='(usuuua{ss})')
+        return self.dbusify_codecs(self.audio_codecs)
 
     def get_video_codecs_dbus(self):
-        codecs = [ (id, name, 0, rate, 0, {} )
-                   for (name, id, rate) in self.video_codecs ]
-        return dbus.Array(codecs, signature='(usuuua{ss})')
+        return self.dbusify_codecs(self.video_codecs)
 
     def get_remote_transports_dbus(self):
         return dbus.Array([
-- 
1.5.6.5




More information about the telepathy-commits mailing list