summaryrefslogtreecommitdiff
path: root/sleekxmpp/test
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2010-11-18 15:50:45 -0500
committerLance Stout <lancestout@gmail.com>2010-11-18 15:50:45 -0500
commitab25301953138343d3d295aaa8872de9c5bc2cf9 (patch)
treeaf0c9bf9edd0814320d67f7a41550732095497ad /sleekxmpp/test
parent291b118aca29b32679f1b2e55d0de98918fe4455 (diff)
downloadslixmpp-ab25301953138343d3d295aaa8872de9c5bc2cf9.tar.gz
slixmpp-ab25301953138343d3d295aaa8872de9c5bc2cf9.tar.bz2
slixmpp-ab25301953138343d3d295aaa8872de9c5bc2cf9.tar.xz
slixmpp-ab25301953138343d3d295aaa8872de9c5bc2cf9.zip
Adding stream tests for XEP-0030.
Fixed some errors when responding to disco requests.
Diffstat (limited to 'sleekxmpp/test')
-rw-r--r--sleekxmpp/test/sleektest.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/sleekxmpp/test/sleektest.py b/sleekxmpp/test/sleektest.py
index 5e61cec2..f1b5ef93 100644
--- a/sleekxmpp/test/sleektest.py
+++ b/sleekxmpp/test/sleektest.py
@@ -257,7 +257,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):
+ port=5222, plugins=None):
"""
Initialize an XMPP client or component using a dummy XML stream.
@@ -277,6 +277,8 @@ class SleekTest(unittest.TestCase):
server -- The name of the XMPP server. Defaults to 'localhost'.
port -- The port to use when connecting to the server.
Defaults to 5222.
+ plugins -- List of plugins to register. By default, all plugins
+ are loaded.
"""
if mode == 'client':
self.xmpp = ClientXMPP(jid, password)
@@ -312,7 +314,11 @@ class SleekTest(unittest.TestCase):
else:
raise ValueError("Unknown socket type.")
- self.xmpp.register_plugins()
+ if plugins is None:
+ self.xmpp.register_plugins()
+ else:
+ for plugin in plugins:
+ self.xmpp.register_plugin(plugin)
self.xmpp.process(threaded=True)
if skip:
if socket != 'live':