[telepathy-gabble/master] bytestream.py: add send_socks5_reply

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Fri Apr 3 09:25:49 PDT 2009


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

diff --git a/tests/twisted/bytestream.py b/tests/twisted/bytestream.py
index 6b35b10..1d2d454 100644
--- a/tests/twisted/bytestream.py
+++ b/tests/twisted/bytestream.py
@@ -197,6 +197,16 @@ def expect_socks5_reply(q):
     streamhost_used = xpath.queryForNodes('/query/streamhost-used', query)[0]
     return streamhost_used
 
+def send_socks5_reply(stream, from_, to, id, stream_used):
+    result = IQ(stream, 'result')
+    result['id'] = id
+    result['from'] = from_
+    result['to'] = to
+    query = result.addElement((ns.BYTESTREAMS, 'query'))
+    streamhost_used = query.addElement((None, 'streamhost-used'))
+    streamhost_used['jid'] = stream_used
+    result.send()
+
 ##### XEP-0047: In-Band Bytestreams (IBB) #####
 
 def send_ibb_open(stream, from_, to, sid, block_size):
-- 
1.5.6.5




More information about the telepathy-commits mailing list