summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit/volume/v2/fakes.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-12-02 21:02:40 +0000
committerGerrit Code Review <review@openstack.org>2016-12-02 21:02:40 +0000
commitd2701116d343f7b597d2a21499dcd2768b64291e (patch)
tree0fad9e08bbd4124feec3e3678430cedd86799b21 /openstackclient/tests/unit/volume/v2/fakes.py
parent4debdc6dbb27d88a6b9d5ce929e403e8e1c81ee3 (diff)
parent094e5189b7bd4a84b124d17a7c70e4f9aaf7ebc7 (diff)
downloadpython-openstackclient-d2701116d343f7b597d2a21499dcd2768b64291e.tar.gz
Merge "Add "consistency group delete" command"
Diffstat (limited to 'openstackclient/tests/unit/volume/v2/fakes.py')
-rw-r--r--openstackclient/tests/unit/volume/v2/fakes.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/openstackclient/tests/unit/volume/v2/fakes.py b/openstackclient/tests/unit/volume/v2/fakes.py
index 41d8e794..3137bfb0 100644
--- a/openstackclient/tests/unit/volume/v2/fakes.py
+++ b/openstackclient/tests/unit/volume/v2/fakes.py
@@ -546,6 +546,30 @@ class FakeConsistencyGroup(object):
return consistency_groups
+ @staticmethod
+ def get_consistency_groups(consistency_groups=None, count=2):
+ """Note:
+
+ Get an iterable MagicMock object with a list of faked
+ consistency_groups.
+
+ If consistency_groups list is provided, then initialize
+ the Mock object with the list. Otherwise create one.
+
+ :param List consistency_groups:
+ A list of FakeResource objects faking consistency_groups
+ :param Integer count:
+ The number of consistency_groups to be faked
+ :return
+ An iterable Mock object with side_effect set to a list of faked
+ consistency_groups
+ """
+ if consistency_groups is None:
+ consistency_groups = (FakeConsistencyGroup.
+ create_consistency_groups(count))
+
+ return mock.Mock(side_effect=consistency_groups)
+
class FakeConsistencyGroupSnapshot(object):
"""Fake one or more consistency group snapshot."""