[Telepathy-commits] [telepathy-gabble/master] Make sync_stream listen for its specific IQ

Will Thompson will.thompson at collabora.co.uk
Wed Feb 4 08:39:53 PST 2009


Previously it accepted any disco#info IQ as proof that Gabble had
processed the IQ it sent it, which is wrong.
---
 tests/twisted/gabbletest.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/tests/twisted/gabbletest.py b/tests/twisted/gabbletest.py
index 065902b..f0e1a08 100644
--- a/tests/twisted/gabbletest.py
+++ b/tests/twisted/gabbletest.py
@@ -70,9 +70,12 @@ def sync_stream(q, stream):
     """Used to ensure that Gabble has processed all stanzas sent to it."""
 
     iq = IQ(stream, "get")
+    id = iq['id']
     iq.addElement(('http://jabber.org/protocol/disco#info', 'query'))
     stream.send(iq)
-    q.expect('stream-iq', query_ns='http://jabber.org/protocol/disco#info')
+    q.expect('stream-iq', query_ns='http://jabber.org/protocol/disco#info',
+        predicate=(lambda event:
+            event.stanza['id'] == id and event.iq_type == 'result'))
 
 class JabberAuthenticator(xmlstream.Authenticator):
     "Trivial XML stream authenticator that accepts one username/digest pair."
-- 
1.5.6.5




More information about the telepathy-commits mailing list