[telepathy-gabble/master] Assert that a GTalk 03 video session always has audio codecs
Sjoerd Simons
sjoerd.simons at collabora.co.uk
Thu Jun 25 09:59:39 PDT 2009
---
tests/twisted/jingle/jingletest2.py | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/tests/twisted/jingle/jingletest2.py b/tests/twisted/jingle/jingletest2.py
index 40e2978..9cce1c2 100644
--- a/tests/twisted/jingle/jingletest2.py
+++ b/tests/twisted/jingle/jingletest2.py
@@ -205,8 +205,19 @@ class GtalkProtocol03(JingleProtocol):
assert xpath.queryForNodes('/session/transport', query) == None
# Exactly one description in Gtalk03
- ds = xpath.queryForNodes('/session/description', query)
- assert len(ds) == 1
+ descs = xpath.queryForNodes('/session/description', query)
+ assert len(descs) == 1
+
+ desc = descs[0]
+
+ # the ds is either audio or video
+ assert desc.uri in [ ns.GOOGLE_SESSION_PHONE, ns.GOOGLE_SESSION_VIDEO ]
+
+ if desc.uri == ns.GOOGLE_SESSION_VIDEO:
+ # If it's a video call there should be some audio codecs as well
+ assert xpath.queryForNodes(
+ '/session/description/payload-type[@xmlns="%s"]' %
+ ns.GOOGLE_SESSION_PHONE, query)
return True
--
1.5.6.5
More information about the telepathy-commits
mailing list