diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-04-20 20:22:55 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-04-20 20:22:55 +0000 |
| commit | e78113a5fcc924eaed8f331b42b314949fc64b12 (patch) | |
| tree | 767356866045cbab860496cd744e70ff68b35187 /openstackclient/tests/volume | |
| parent | 98a0fba3c1fc8e5fa231d07349cb38102b015cc4 (diff) | |
| parent | 09c20b2b5c53024c47da8828095ea95dc63810f6 (diff) | |
| download | python-openstackclient-e78113a5fcc924eaed8f331b42b314949fc64b12.tar.gz | |
Merge "Fix mutable default arguments in tests"
Diffstat (limited to 'openstackclient/tests/volume')
| -rw-r--r-- | openstackclient/tests/volume/v2/fakes.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/openstackclient/tests/volume/v2/fakes.py b/openstackclient/tests/volume/v2/fakes.py index 6e631c41..b7994b5f 100644 --- a/openstackclient/tests/volume/v2/fakes.py +++ b/openstackclient/tests/volume/v2/fakes.py @@ -281,7 +281,7 @@ class FakeVolume(object): """ @staticmethod - def create_one_volume(attrs={}): + def create_one_volume(attrs=None): """Create a fake volume. :param Dictionary attrs: @@ -289,6 +289,8 @@ class FakeVolume(object): :retrun: A FakeResource object with id, name, status, etc. """ + attrs = attrs or {} + # Set default attribute volume_info = { 'id': 'volume-id' + uuid.uuid4().hex, @@ -320,7 +322,7 @@ class FakeVolume(object): return volume @staticmethod - def create_volumes(attrs={}, count=2): + def create_volumes(attrs=None, count=2): """Create multiple fake volumes. :param Dictionary attrs: @@ -361,7 +363,7 @@ class FakeAvailabilityZone(object): """Fake one or more volume availability zones (AZs).""" @staticmethod - def create_one_availability_zone(attrs={}): + def create_one_availability_zone(attrs=None): """Create a fake AZ. :param Dictionary attrs: @@ -369,6 +371,8 @@ class FakeAvailabilityZone(object): :return: A FakeResource object with zoneName, zoneState, etc. """ + attrs = attrs or {} + # Set default attributes. availability_zone = { 'zoneName': uuid.uuid4().hex, @@ -384,7 +388,7 @@ class FakeAvailabilityZone(object): return availability_zone @staticmethod - def create_availability_zones(attrs={}, count=2): + def create_availability_zones(attrs=None, count=2): """Create multiple fake AZs. :param Dictionary attrs: |
