[telepathy-gabble/master] Add basic validation for GTalk03

Sjoerd Simons sjoerd.simons at collabora.co.uk
Thu Jun 25 09:59:36 PDT 2009


---
 tests/twisted/jingle/jingletest2.py |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/tests/twisted/jingle/jingletest2.py b/tests/twisted/jingle/jingletest2.py
index abd4731..40e2978 100644
--- a/tests/twisted/jingle/jingletest2.py
+++ b/tests/twisted/jingle/jingletest2.py
@@ -7,7 +7,7 @@
 # This can be used in parallel with the old API, but should
 # obsolete it in time.
 
-from twisted.words.xish import domish
+from twisted.words.xish import domish, xpath
 import random
 from gabbletest import sync_stream, exec_test
 from servicetest import EventPattern
@@ -199,6 +199,17 @@ class GtalkProtocol03(JingleProtocol):
     def can_do_video_only(self):
         return False
 
+    def validate_session_initiate(self, query):
+        assert query['id'] != None
+        # No transport in GTalk03
+        assert xpath.queryForNodes('/session/transport', query) == None
+
+        # Exactly one description in Gtalk03
+        ds = xpath.queryForNodes('/session/description', query)
+        assert len(ds) == 1
+
+        return True
+
     def seperate_contents(self):
         return False
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list