[Telepathy-commits] [telepathy-gabble/master] check S5B IQ reply

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Tue Mar 3 09:07:56 PST 2009


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

diff --git a/tests/twisted/bytestream.py b/tests/twisted/bytestream.py
index 6b5a449..77b57ce 100644
--- a/tests/twisted/bytestream.py
+++ b/tests/twisted/bytestream.py
@@ -161,6 +161,10 @@ class BytestreamS5B(Bytestream):
         # FIXME: This is wrong. Change once SOCKS5 is fixed
         self.transport.write('\x05\x00') #version 5, ok
 
+    def _check_s5b_reply(self, iq):
+        streamhost = xpath.queryForNodes('/iq/query/streamhost-used', iq)[0]
+        assert streamhost['jid'] == self.initiator
+
     def _socks5_expect_connection(self, expected):
         if expected is not None:
             event, _ = self.q.expect_many(expected,
@@ -174,6 +178,10 @@ class BytestreamS5B(Bytestream):
         self._wait_connect_cmd()
         self._send_connect_reply()
 
+        # wait for S5B IQ reply
+        e = self.q.expect('stream-iq', iq_type='result', to=self.initiator)
+        self._check_s5b_reply(e.stanza)
+
         return event
 
     def _listen_socks5(self):
-- 
1.5.6.5




More information about the telepathy-commits mailing list