python-openstackclient/openstackclient/tests/image
Tang Chen 09c20b2b5c 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
..
v1 [Image] Check return value is None in image unit tests. 2016-03-02 16:16:37 +08:00
v2 Fix mutable default arguments in tests 2016-04-20 11:15:17 +08:00
__init__.py Remove copyright from empty files 2014-01-20 17:28:13 +04:00