summaryrefslogtreecommitdiff
path: root/sleekxmpp/test
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-09-28 22:48:30 -0400
committerLance Stout <lancestout@gmail.com>2011-09-28 22:48:30 -0400
commite37adace62ee7bb8a29f661ac33853d94456d35f (patch)
tree69bc8587c4cb8998c533a7665f7f580feb41db79 /sleekxmpp/test
parentd10f591bf4b84264df84d12e9d7ec380934c3887 (diff)
downloadslixmpp-e37adace62ee7bb8a29f661ac33853d94456d35f.tar.gz
slixmpp-e37adace62ee7bb8a29f661ac33853d94456d35f.tar.bz2
slixmpp-e37adace62ee7bb8a29f661ac33853d94456d35f.tar.xz
slixmpp-e37adace62ee7bb8a29f661ac33853d94456d35f.zip
Allow SASL mechanism to be set when creating a ClientXMPP instance.
Instead of using: ClientXMPP(jid, password, plugin_config={ 'feature_mechanisms': {'use_mech': 'SOME-MECH'}}) You can use: ClientXMPP(jid, password, sasl_mech='SOME-MECH') If you need to change the mechanism after instantiation, use: xmpp['feature_mechanisms'].sasl.mech = 'SCRAM-MD5'
Diffstat (limited to 'sleekxmpp/test')
-rw-r--r--sleekxmpp/test/sleektest.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/sleekxmpp/test/sleektest.py b/sleekxmpp/test/sleektest.py
index a94bb4e5..dd3df29a 100644
--- a/sleekxmpp/test/sleektest.py
+++ b/sleekxmpp/test/sleektest.py
@@ -293,7 +293,8 @@ 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, plugin_config={}):
+ port=5222, sasl_mech=None,
+ plugins=None, plugin_config={}):
"""
Initialize an XMPP client or component using a dummy XML stream.
@@ -317,7 +318,9 @@ class SleekTest(unittest.TestCase):
are loaded.
"""
if mode == 'client':
- self.xmpp = ClientXMPP(jid, password, plugin_config=plugin_config)
+ self.xmpp = ClientXMPP(jid, password,
+ sasl_mech=sasl_mech,
+ plugin_config=plugin_config)
elif mode == 'component':
self.xmpp = ComponentXMPP(jid, password,
server, port,