summaryrefslogtreecommitdiff
path: root/sleekxmpp/test
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2014-08-17 17:20:26 -0700
committerLance Stout <lancestout@gmail.com>2014-08-17 17:20:26 -0700
commitca306e7cecee4bf7afd9ce44f5f067b305928682 (patch)
tree3641ff7754a221a53d6b5af08ffefa3f6898627d /sleekxmpp/test
parenta5c03b763a6545a214f4f391f7c07582c22150b2 (diff)
parent1bf34f7fe694c2997710e0d23b0784e824df5e5e (diff)
downloadslixmpp-ca306e7cecee4bf7afd9ce44f5f067b305928682.tar.gz
slixmpp-ca306e7cecee4bf7afd9ce44f5f067b305928682.tar.bz2
slixmpp-ca306e7cecee4bf7afd9ce44f5f067b305928682.tar.xz
slixmpp-ca306e7cecee4bf7afd9ce44f5f067b305928682.zip
Merge pull request #310 from Mayflower/cleanup
Cleanup
Diffstat (limited to 'sleekxmpp/test')
-rw-r--r--sleekxmpp/test/sleektest.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/sleekxmpp/test/sleektest.py b/sleekxmpp/test/sleektest.py
index d28f77e2..e26f99ce 100644
--- a/sleekxmpp/test/sleektest.py
+++ b/sleekxmpp/test/sleektest.py
@@ -288,11 +288,8 @@ class SleekTest(unittest.TestCase):
if self.xmpp:
self.xmpp.socket.disconnect_error()
- def stream_start(self, mode='client', skip=True, header=None,
- socket='mock', jid='tester@localhost',
- password='test', server='localhost',
- port=5222, sasl_mech=None,
- plugins=None, plugin_config={}):
+ def stream_start(self, mode='client', skip=True, header=None, socket='mock', jid='tester@localhost',
+ password='test', server='localhost', port=5222, sasl_mech=None, plugins=None, plugin_config=None):
"""
Initialize an XMPP client or component using a dummy XML stream.
@@ -315,6 +312,9 @@ class SleekTest(unittest.TestCase):
plugins -- List of plugins to register. By default, all plugins
are loaded.
"""
+ if not plugin_config:
+ plugin_config = {}
+
if mode == 'client':
self.xmpp = ClientXMPP(jid, password,
sasl_mech=sasl_mech,
@@ -425,8 +425,7 @@ class SleekTest(unittest.TestCase):
parts.append('xmlns="%s"' % default_ns)
return header % ' '.join(parts)
- def recv(self, data, defaults=[], method='exact',
- use_values=True, timeout=1):
+ def recv(self, data, defaults=None, method='exact', use_values=True, timeout=1):
"""
Pass data to the dummy XMPP client as if it came from an XMPP server.
@@ -447,6 +446,9 @@ class SleekTest(unittest.TestCase):
timeout -- Time to wait in seconds for data to be received by
a live connection.
"""
+ if not defaults:
+ defaults = []
+
if self.xmpp.socket.is_live:
# we are working with a live connection, so we should
# verify what has been received instead of simulating