remove the default arguments "{}"

remove the default arguments "{}" when the function is defined.

Change-Id: I81efaf299bc058208a5f553432068e93712cba83
ref: http://docs.python-guide.org/en/latest/writing/gotchas/
This commit is contained in:
Javeme
2015-12-07 21:03:41 +08:00
committed by Steve Martinelli
parent 92fb876c35
commit 7a4f019764

View File

@@ -328,7 +328,9 @@ class RedirectTests(utils.TestCase):
DEFAULT_RESP_BODY = 'Found'
def setup_redirects(self, method='GET', status_code=305,
redirect_kwargs={}, final_kwargs={}):
redirect_kwargs=None, final_kwargs=None):
redirect_kwargs = redirect_kwargs or {}
final_kwargs = final_kwargs or {}
redirect_kwargs.setdefault('text', self.DEFAULT_REDIRECT_BODY)
for s, d in zip(self.REDIRECT_CHAIN, self.REDIRECT_CHAIN[1:]):