summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit/volume/v1/fakes.py
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2021-06-03 11:09:47 +0100
committerStephen Finucane <sfinucan@redhat.com>2021-06-03 15:52:18 +0100
commit5faa9ef8058a161a0637dceb91f213ac5ac39070 (patch)
tree8871fdb53f9d964bc523a9cecffe97788e2c310e /openstackclient/tests/unit/volume/v1/fakes.py
parent524af4a23efde62989ad55ecebabff0b50395308 (diff)
downloadpython-openstackclient-5faa9ef8058a161a0637dceb91f213ac5ac39070.tar.gz
tests: Rename 'FakeType' -> 'FakeVolumeType'
There are more types than just volume types. Change-Id: I6af66f966a221437ff79fabcb0b81fd38586fe67 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to 'openstackclient/tests/unit/volume/v1/fakes.py')
-rw-r--r--openstackclient/tests/unit/volume/v1/fakes.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/openstackclient/tests/unit/volume/v1/fakes.py b/openstackclient/tests/unit/volume/v1/fakes.py
index adb775ed..438a60ad 100644
--- a/openstackclient/tests/unit/volume/v1/fakes.py
+++ b/openstackclient/tests/unit/volume/v1/fakes.py
@@ -400,12 +400,12 @@ class TestVolumev1(utils.TestCommand):
)
-class FakeType(object):
+class FakeVolumeType(object):
"""Fake one or more type."""
@staticmethod
- def create_one_type(attrs=None, methods=None):
- """Create a fake type.
+ def create_one_volume_type(attrs=None, methods=None):
+ """Create a fake volume type.
:param Dictionary attrs:
A dictionary with all attributes
@@ -418,7 +418,7 @@ class FakeType(object):
methods = methods or {}
# Set default attributes.
- type_info = {
+ volume_type_info = {
"id": 'type-id-' + uuid.uuid4().hex,
"name": 'type-name-' + uuid.uuid4().hex,
"description": 'type-description-' + uuid.uuid4().hex,
@@ -427,16 +427,16 @@ class FakeType(object):
}
# Overwrite default attributes.
- type_info.update(attrs)
+ volume_type_info.update(attrs)
volume_type = fakes.FakeResource(
- info=copy.deepcopy(type_info),
+ info=copy.deepcopy(volume_type_info),
methods=methods,
loaded=True)
return volume_type
@staticmethod
- def create_types(attrs=None, count=2):
+ def create_volume_types(attrs=None, count=2):
"""Create multiple fake types.
:param Dictionary attrs:
@@ -448,19 +448,19 @@ class FakeType(object):
"""
volume_types = []
for i in range(0, count):
- volume_type = FakeType.create_one_type(attrs)
+ volume_type = FakeVolumeType.create_one_volume_type(attrs)
volume_types.append(volume_type)
return volume_types
@staticmethod
- def get_types(types=None, count=2):
+ def get_volume_types(volume_types=None, count=2):
"""Get an iterable MagicMock object with a list of faked types.
If types list is provided, then initialize the Mock object with the
list. Otherwise create one.
- :param List types:
+ :param List volume_types:
A list of FakeResource objects faking types
:param Integer count:
The number of types to be faked
@@ -468,14 +468,14 @@ class FakeType(object):
An iterable Mock object with side_effect set to a list of faked
types
"""
- if types is None:
- types = FakeType.create_types(count)
+ if volume_types is None:
+ volume_types = FakeVolumeType.create_volume_types(count)
- return mock.Mock(side_effect=types)
+ return mock.Mock(side_effect=volume_types)
@staticmethod
- def create_one_encryption_type(attrs=None):
- """Create a fake encryption type.
+ def create_one_encryption_volume_type(attrs=None):
+ """Create a fake encryption volume type.
:param Dictionary attrs:
A dictionary with all attributes