osc-lib/openstackclient/tests
Tang Chen 71c042b275 Fix mutable default arguments in tests
Python’s default arguments are evaluated only once
when the function is defined, not each time the
function is called. This means that if you use a
mutable default argument (like list and dict) and
mutate it, you will and have mutated that object
for all future calls to the function as well.

More details about this wrong usage here:
http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments

In unit tests, most FakeXXX classes' methods take
mutable arguments with default values [] or {}.
We should change them to None.

Change-Id: Iea833b66aa1379829511ad5c6d4432b72f3488e2
Closed-bug: #1550320
2016-04-20 11:15:17 +08:00
..
api Move session and fixtures to keystoneauth1 2015-10-14 00:46:07 -04:00
common Propagate AttributeErrors when lazily loading plugins 2016-04-14 21:12:35 -07:00
__init__.py Remove copyright from empty files 2014-01-20 17:28:13 +04:00
fakes.py Fix mutable default arguments in tests 2016-04-20 11:15:17 +08:00
test_shell.py Rename --profile to --os-profile 2016-04-19 07:50:42 -05:00
utils.py remove py26 workaround in osc 2016-03-08 12:41:17 +00:00