[telepathy-salut/master] xmppstream: add connect_to_stream6

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Wed Apr 1 08:29:48 PDT 2009


---
 tests/twisted/xmppstream.py |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/tests/twisted/xmppstream.py b/tests/twisted/xmppstream.py
index 5c987bc..89debc1 100644
--- a/tests/twisted/xmppstream.py
+++ b/tests/twisted/xmppstream.py
@@ -11,7 +11,7 @@ from twisted.words.xish import domish, xpath, xmlstream
 from twisted.internet.protocol import Factory, ClientFactory
 from twisted.internet import reactor
 
-from ipv6 import listenTCP6
+from ipv6 import listenTCP6, connectTCP6
 
 NS_STREAMS = 'http://etherx.jabber.org/streams'
 
@@ -193,6 +193,18 @@ def connect_to_stream(queue, name, remote_name, host, port, protocol = None):
 
     return p
 
+def connect_to_stream6(queue, name, remote_name, host, port, protocol = None):
+    if protocol == None:
+        protocol = OutgoingXmppStream
+
+    p = protocol(queue.append, name, remote_name)
+
+    factory = OutgoingXmppFactory(queue.append)
+    factory.protocol = lambda *args: p
+    connectTCP6(reactor, host, port, factory)
+
+    return p
+
 if __name__ == '__main__':
     def run_test():
         q = servicetest.IteratingEventQueue()
-- 
1.5.6.5




More information about the telepathy-commits mailing list