diff options
author | Robert Robinson <rerobins@gmail.com> | 2015-09-18 13:30:30 -0600 |
---|---|---|
committer | Robert Robinson <rerobins@gmail.com> | 2015-09-18 13:30:30 -0600 |
commit | 5fc14de32e7fbd4e33a0e1ed92d8fb23871a2a2d (patch) | |
tree | d21287dbbb7882b766098e0a81c0d1d3677d28d3 /sleekxmpp/test | |
parent | e5582694c07236e6830c20361840360a1dde37f3 (diff) | |
parent | d245558fd5eeee4fa34731ccea47c4c3132d805f (diff) | |
download | slixmpp-5fc14de32e7fbd4e33a0e1ed92d8fb23871a2a2d.tar.gz slixmpp-5fc14de32e7fbd4e33a0e1ed92d8fb23871a2a2d.tar.bz2 slixmpp-5fc14de32e7fbd4e33a0e1ed92d8fb23871a2a2d.tar.xz slixmpp-5fc14de32e7fbd4e33a0e1ed92d8fb23871a2a2d.zip |
Merge pull request #3 from fritzy/develop
Merge to fritzy_master
Diffstat (limited to 'sleekxmpp/test')
-rw-r--r-- | sleekxmpp/test/sleektest.py | 16 |
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 |