diff options
author | Lance Stout <lancestout@gmail.com> | 2011-09-28 17:26:29 -0400 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2011-09-28 17:26:29 -0400 |
commit | d10f591bf4b84264df84d12e9d7ec380934c3887 (patch) | |
tree | 3ed4f76a0d0a68a2a2f06a1f562801da70113274 | |
parent | 262da78ca7c5b71901f0f23111ef65156ac56463 (diff) | |
download | slixmpp-d10f591bf4b84264df84d12e9d7ec380934c3887.tar.gz slixmpp-d10f591bf4b84264df84d12e9d7ec380934c3887.tar.bz2 slixmpp-d10f591bf4b84264df84d12e9d7ec380934c3887.tar.xz slixmpp-d10f591bf4b84264df84d12e9d7ec380934c3887.zip |
Expand live stream testing capabilities.
-rw-r--r-- | sleekxmpp/test/sleektest.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sleekxmpp/test/sleektest.py b/sleekxmpp/test/sleektest.py index 0f35e28c..a94bb4e5 100644 --- a/sleekxmpp/test/sleektest.py +++ b/sleekxmpp/test/sleektest.py @@ -293,7 +293,7 @@ class SleekTest(unittest.TestCase): def stream_start(self, mode='client', skip=True, header=None, socket='mock', jid='tester@localhost', password='test', server='localhost', - port=5222, plugins=None): + port=5222, plugins=None, plugin_config={}): """ Initialize an XMPP client or component using a dummy XML stream. @@ -317,10 +317,11 @@ class SleekTest(unittest.TestCase): are loaded. """ if mode == 'client': - self.xmpp = ClientXMPP(jid, password) + self.xmpp = ClientXMPP(jid, password, plugin_config=plugin_config) elif mode == 'component': self.xmpp = ComponentXMPP(jid, password, - server, port) + server, port, + plugin_config=plugin_config) else: raise ValueError("Unknown XMPP connection mode.") @@ -347,7 +348,10 @@ class SleekTest(unittest.TestCase): skip_queue.put('started') self.xmpp.add_event_handler('session_start', wait_for_session) - self.xmpp.connect() + if server is not None: + self.xmpp.connect((server, port)) + else: + self.xmpp.connect() else: raise ValueError("Unknown socket type.") |