From 32ae1857d12fc2d5b4292e2d98caed0238959081 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Tue, 19 Jan 2021 17:11:48 +0000 Subject: Rename FakeServerMigration to FakeMigration Server migrations are (confusingly) a different thing returned by a different API. Change-Id: Ib6b7c8f9cc3d1521a993616f832d41651dc46f73 Signed-off-by: Stephen Finucane --- openstackclient/tests/unit/compute/v2/fakes.py | 20 ++++++++++---------- openstackclient/tests/unit/compute/v2/test_server.py | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'openstackclient/tests/unit') diff --git a/openstackclient/tests/unit/compute/v2/fakes.py b/openstackclient/tests/unit/compute/v2/fakes.py index e4cf1045..7f3dcae4 100644 --- a/openstackclient/tests/unit/compute/v2/fakes.py +++ b/openstackclient/tests/unit/compute/v2/fakes.py @@ -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. """ diff --git a/openstackclient/tests/unit/compute/v2/test_server.py b/openstackclient/tests/unit/compute/v2/test_server.py index 5cf76c88..5025f020 100644 --- a/openstackclient/tests/unit/compute/v2/test_server.py +++ b/openstackclient/tests/unit/compute/v2/test_server.py @@ -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( -- cgit v1.2.1