[telepathy-gabble-0.16] telepathy-gabble: Verify that every caps 'ext' we ever advertise can be disco'd without error

Simon McVittie smcv at kemper.freedesktop.org
Tue Sep 11 04:26:47 PDT 2012


Module: telepathy-gabble
Branch: telepathy-gabble-0.16
Commit: 8a6e9461f9cc12788532441bcc6f43fa7df4913f
URL:    http://cgit.freedesktop.org/telepathy/telepathy-gabble/commit/?id=8a6e9461f9cc12788532441bcc6f43fa7df4913f

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Fri Sep  7 15:22:30 2012 +0100

Verify that every caps 'ext' we ever advertise can be disco'd without error

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54634
Signed-off-by: Simon McVittie <simon.mcvittie at collabora.co.uk>
Reviewed-by: Sjoerd Simons <sjoerd.simons at collabora.co.uk>

---

 tests/twisted/caps/trust-thyself.py |   25 ++++++++++++++-----------
 1 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/tests/twisted/caps/trust-thyself.py b/tests/twisted/caps/trust-thyself.py
index 310fb4f..34a145b 100644
--- a/tests/twisted/caps/trust-thyself.py
+++ b/tests/twisted/caps/trust-thyself.py
@@ -60,18 +60,21 @@ def test(q, bus, conn, stream):
     c_ = xpath.queryForNodes('/presence/c', self_presence.stanza)[0]
     assertNotEquals(c['ver'], c_['ver'])
 
-    # But then someone asks us for our old caps
-    iq = IQ(stream, 'get')
-    iq['from'] = jid
-    query = iq.addElement((ns.DISCO_INFO, 'query'))
-    query['node'] = c['node'] + '#' + c['ver']
-    stream.send(iq)
+    for suffix in [c['ver'], 'voice-v1', 'video-v1', 'camera-v1', 'share-v1',
+            'pmuc-v1'] + list(c_['ext'].split()):
+        # But then someone asks us for our old caps
+        iq = IQ(stream, 'get')
+        iq['from'] = jid
+        query = iq.addElement((ns.DISCO_INFO, 'query'))
+        query['node'] = c['node'] + '#' + suffix
+        stream.send(iq)
 
-    # Gabble should still know what they are, and reply. This is actually quite
-    # important: there's a bug in iChat where if you return an error to a disco
-    # query, it just asks again, and again, and again...
-    reply = q.expect('stream-iq', to=jid)
-    assertEquals('result', reply.iq_type)
+        # Gabble should still know what they are, and reply. This is
+        # actually quite important: there's a bug in iChat where if you
+        # return an error to a disco query, it just asks again, and again,
+        # and again...
+        reply = q.expect('stream-iq', to=jid)
+        assertEquals('result', reply.iq_type)
 
 if __name__ == '__main__':
     exec_test(test)



More information about the telepathy-commits mailing list