diff options
| author | Stephen Finucane <sfinucan@redhat.com> | 2022-12-14 11:19:04 +0000 |
|---|---|---|
| committer | Stephen Finucane <sfinucan@redhat.com> | 2023-05-16 16:21:44 +0100 |
| commit | 19be070204ae52e342ba2c18f6cc519d617230ab (patch) | |
| tree | 32bf4eb28350d10d671ba1213dd7348589f77487 /openstackclient/tests/unit/common | |
| parent | 347b444feb19ddb13a5b1a66d049eb0d818cbe77 (diff) | |
| download | python-openstackclient-19be070204ae52e342ba2c18f6cc519d617230ab.tar.gz | |
tests: Remove unnecessary nesting of compute resources
Change-Id: I27326b8f2e0d84d3ef2c2fbdcb5c96a5ac1d79e4
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to 'openstackclient/tests/unit/common')
4 files changed, 12 insertions, 18 deletions
diff --git a/openstackclient/tests/unit/common/test_availability_zone.py b/openstackclient/tests/unit/common/test_availability_zone.py index 99315eae..2ee6e2c4 100644 --- a/openstackclient/tests/unit/common/test_availability_zone.py +++ b/openstackclient/tests/unit/common/test_availability_zone.py @@ -114,9 +114,7 @@ class TestAvailabilityZone(utils.TestCommand): class TestAvailabilityZoneList(TestAvailabilityZone): - compute_azs = ( - compute_fakes.FakeAvailabilityZone.create_availability_zones() - ) + compute_azs = compute_fakes.create_availability_zones() volume_azs = volume_fakes.create_availability_zones(count=1) network_azs = network_fakes.create_availability_zones() diff --git a/openstackclient/tests/unit/common/test_extension.py b/openstackclient/tests/unit/common/test_extension.py index 56b2ccea..0771036f 100644 --- a/openstackclient/tests/unit/common/test_extension.py +++ b/openstackclient/tests/unit/common/test_extension.py @@ -72,7 +72,7 @@ class TestExtensionList(TestExtension): volume_extension = volume_fakes.create_one_extension() identity_extension = identity_fakes.FakeExtension.create_one_extension() - compute_extension = compute_fakes.FakeExtension.create_one_extension() + compute_extension = compute_fakes.create_one_extension() network_extension = network_fakes.FakeExtension.create_one_extension() def setUp(self): diff --git a/openstackclient/tests/unit/common/test_project_purge.py b/openstackclient/tests/unit/common/test_project_purge.py index ae3f58ec..850adb5b 100644 --- a/openstackclient/tests/unit/common/test_project_purge.py +++ b/openstackclient/tests/unit/common/test_project_purge.py @@ -67,7 +67,7 @@ class TestProjectPurgeInit(tests_utils.TestCommand): class TestProjectPurge(TestProjectPurgeInit): project = identity_fakes.FakeProject.create_one_project() - server = compute_fakes.FakeServer.create_one_server() + server = compute_fakes.create_one_server() image = image_fakes.create_one_image() volume = volume_fakes.create_one_volume() backup = volume_fakes.create_one_backup() diff --git a/openstackclient/tests/unit/common/test_quota.py b/openstackclient/tests/unit/common/test_quota.py index 4487014c..766599c9 100644 --- a/openstackclient/tests/unit/common/test_quota.py +++ b/openstackclient/tests/unit/common/test_quota.py @@ -123,12 +123,12 @@ class TestQuotaList(TestQuota): self.projects_mock.list.return_value = self.projects self.compute_quotas = [ - compute_fakes.FakeQuota.create_one_comp_quota(), - compute_fakes.FakeQuota.create_one_comp_quota(), + compute_fakes.create_one_comp_quota(), + compute_fakes.create_one_comp_quota(), ] self.compute_default_quotas = [ - compute_fakes.FakeQuota.create_one_default_comp_quota(), - compute_fakes.FakeQuota.create_one_default_comp_quota(), + compute_fakes.create_one_default_comp_quota(), + compute_fakes.create_one_default_comp_quota(), ] self.compute = self.app.client_manager.compute self.compute.quotas.defaults = mock.Mock( @@ -216,9 +216,7 @@ class TestQuotaList(TestQuota): return reference_data def test_quota_list_details_compute(self): - detailed_quota = ( - compute_fakes.FakeQuota.create_one_comp_detailed_quota() - ) + detailed_quota = compute_fakes.create_one_comp_detailed_quota() detailed_column_header = ( 'Resource', @@ -338,7 +336,7 @@ class TestQuotaList(TestQuota): self.compute.quotas.get = mock.Mock( side_effect=[ self.compute_quotas[0], - compute_fakes.FakeQuota.create_one_default_comp_quota(), + compute_fakes.create_one_default_comp_quota(), ], ) @@ -1087,10 +1085,10 @@ class TestQuotaShow(TestQuota): def setUp(self): super().setUp() - self.compute_quota = compute_fakes.FakeQuota.create_one_comp_quota() + self.compute_quota = compute_fakes.create_one_comp_quota() self.compute_quotas_mock.get.return_value = self.compute_quota self.compute_default_quota = ( - compute_fakes.FakeQuota.create_one_default_comp_quota() + compute_fakes.create_one_default_comp_quota() ) self.compute_quotas_mock.defaults.return_value = ( self.compute_default_quota @@ -1269,9 +1267,7 @@ class TestQuotaShow(TestQuota): def test_quota_show__with_usage(self): # update mocks to return detailed quota instead - self.compute_quota = ( - compute_fakes.FakeQuota.create_one_comp_detailed_quota() - ) + self.compute_quota = compute_fakes.create_one_comp_detailed_quota() self.compute_quotas_mock.get.return_value = self.compute_quota self.volume_quota = volume_fakes.create_one_detailed_quota() self.volume_quotas_mock.get.return_value = self.volume_quota |
