Skip to content

Commit 50b1bab

Browse files
committed
volume: Migrate 'volume consistency group *' to SDK
Change-Id: I9c193e3e602a71e1f1542d62b7362a66b10fad79 Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Assisted-by: Claude Opus 4.6 <noreply@anthropic.com> Depends-on: https://review.opendev.org/c/openstack/openstacksdk/+/994114
1 parent 0e0a41d commit 50b1bab

6 files changed

Lines changed: 765 additions & 731 deletions

File tree

openstackclient/tests/unit/volume/v2/fakes.py

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -435,47 +435,6 @@ def create_one_consistency_group(attrs=None):
435435
return consistency_group
436436

437437

438-
def create_consistency_groups(attrs=None, count=2):
439-
"""Create multiple fake consistency groups.
440-
441-
:param dict attrs:
442-
A dictionary with all attributes
443-
:param int count:
444-
The number of consistency groups to fake
445-
:return:
446-
A list of FakeResource objects faking the consistency groups
447-
"""
448-
consistency_groups = []
449-
for i in range(0, count):
450-
consistency_group = create_one_consistency_group(attrs)
451-
consistency_groups.append(consistency_group)
452-
453-
return consistency_groups
454-
455-
456-
def get_consistency_groups(consistency_groups=None, count=2):
457-
"""Note:
458-
459-
Get an iterable MagicMock object with a list of faked
460-
consistency_groups.
461-
462-
If consistency_groups list is provided, then initialize
463-
the Mock object with the list. Otherwise create one.
464-
465-
:param List consistency_groups:
466-
A list of FakeResource objects faking consistency_groups
467-
:param Integer count:
468-
The number of consistency_groups to be faked
469-
:return
470-
An iterable Mock object with side_effect set to a list of faked
471-
consistency_groups
472-
"""
473-
if consistency_groups is None:
474-
consistency_groups = create_consistency_groups(count)
475-
476-
return mock.Mock(side_effect=consistency_groups)
477-
478-
479438
def create_one_consistency_group_snapshot(attrs=None):
480439
"""Create a fake consistency group snapshot.
481440

0 commit comments

Comments
 (0)