From 39dd9c5a2a5f007d4d38136c2acede99d96d61e2 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 7 Sep 2012 15:22:30 +0100 Subject: [PATCH 3/4] 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 --- tests/twisted/caps/trust-thyself.py | 25 ++++++++++++++----------- 1 file 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) -- 1.7.10.4