[Telepathy-commits] [telepathy-gabble/master] gabbletest.py: add sync_stream function to allow forcing processing of sent stanzas

Dafydd Harries dafydd.harries at collabora.co.uk
Tue Aug 19 10:52:21 PDT 2008


20080507022711-c9803-c1661ece9b5493301293a96c9d96d3ab69ebdc3b.gz
---
 tests/twisted/gabbletest.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/tests/twisted/gabbletest.py b/tests/twisted/gabbletest.py
index a0c89f9..1d009c7 100644
--- a/tests/twisted/gabbletest.py
+++ b/tests/twisted/gabbletest.py
@@ -33,6 +33,14 @@ def make_result_iq(stream, iq):
 def acknowledge_iq(stream, iq):
     stream.send(make_result_iq(stream, iq))
 
+def sync_stream(q, stream):
+    """Used to ensure that Gabble has processed all stanzas sent to it."""
+
+    iq = IQ(stream, "get")
+    iq.addElement(('http://jabber.org/protocol/disco#info', 'query'))
+    stream.send(iq)
+    q.expect('stream-iq', query_ns='http://jabber.org/protocol/disco#info')
+
 class JabberAuthenticator(xmlstream.Authenticator):
     "Trivial XML stream authenticator that accepts one username/digest pair."
 
-- 
1.5.6.3




More information about the Telepathy-commits mailing list