Merge "Rename FakeServerMigration to FakeMigration"

This commit is contained in:
Zuul 2021-03-04 16:51:12 +00:00 committed by Gerrit Code Review
commit 82770fa6c0
2 changed files with 12 additions and 12 deletions

View file

@ -1566,12 +1566,12 @@ class FakeRateLimit(object):
self.next_available = next_available
class FakeServerMigration(object):
"""Fake one or more server migrations."""
class FakeMigration(object):
"""Fake one or more migrations."""
@staticmethod
def create_one_server_migration(attrs=None, methods=None):
"""Create a fake server migration.
def create_one_migration(attrs=None, methods=None):
"""Create a fake migration.
:param Dictionary attrs:
A dictionary with all attributes
@ -1612,22 +1612,22 @@ class FakeServerMigration(object):
return migration
@staticmethod
def create_server_migrations(attrs=None, methods=None, count=2):
"""Create multiple fake server migrations.
def create_migrations(attrs=None, methods=None, count=2):
"""Create multiple fake migrations.
:param Dictionary attrs:
A dictionary with all attributes
:param Dictionary methods:
A dictionary with all methods
:param int count:
The number of server migrations to fake
The number of migrations to fake
:return:
A list of FakeResource objects faking the server migrations
A list of FakeResource objects faking the migrations
"""
migrations = []
for i in range(0, count):
migrations.append(
FakeServerMigration.create_one_server_migration(
FakeMigration.create_one_migration(
attrs, methods))
return migrations
@ -1680,7 +1680,7 @@ class FakeVolumeAttachment(object):
:param Dictionary methods:
A dictionary with all methods
:param int count:
The number of server migrations to fake
The number of volume attachments to fake
:return:
A list of FakeResource objects faking the volume attachments.
"""

View file

@ -4396,8 +4396,8 @@ class TestListMigration(TestServer):
self.server = compute_fakes.FakeServer.create_one_server()
self.servers_mock.get.return_value = self.server
self.migrations = compute_fakes.FakeServerMigration\
.create_server_migrations(count=3)
self.migrations = compute_fakes.FakeMigration.create_migrations(
count=3)
self.migrations_mock.list.return_value = self.migrations
self.data = (common_utils.get_item_properties(