[Telepathy-commits] [telepathy-gabble/master] test-caps-tubes: check if the caps announced by Gabble matches the hash

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Tue Jan 27 03:44:56 PST 2009


---
 tests/twisted/test-caps-tubes.py |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/tests/twisted/test-caps-tubes.py b/tests/twisted/test-caps-tubes.py
index d83b5a6..2ed1fe0 100644
--- a/tests/twisted/test-caps-tubes.py
+++ b/tests/twisted/test-caps-tubes.py
@@ -40,6 +40,9 @@ from servicetest import EventPattern
 from gabbletest import exec_test, make_result_iq, sync_stream
 from constants import *
 
+from caps_helper import compute_caps_hash
+from config import PACKAGE_STRING
+
 ns_tubes = 'http://telepathy.freedesktop.org/xmpp/tubes'
 
 text_fixed_properties = dbus.Dictionary({
@@ -133,6 +136,13 @@ def receive_presence_and_ask_caps(q, stream):
         query_ns='http://jabber.org/protocol/disco#info')
     caps_str = str(xpath.queryForNodes('/iq/query/feature', event.stanza))
 
+    features = []
+    for feature in xpath.queryForNodes('/iq/query/feature', event.stanza):
+        features.append(feature['var'])
+
+    # Check if the hash matches the announced capabilities
+    assert ver == compute_caps_hash(['client/pc//%s' % PACKAGE_STRING], features, [])
+
     return (event, caps_str, signaled_caps)
 
 def caps_contain(event, cap):
-- 
1.5.6.5




More information about the Telepathy-commits mailing list