From 2232ca95f22478bc90da5cb2d99cb0a4570fbc96 Mon Sep 17 00:00:00 2001 From: Sean Mooney Date: Tue, 3 Oct 2023 11:08:55 +0100 Subject: [PATCH] [codespell] fix typos in tests this mainly fixes typos in the tests and one type in an exception message. some addtional items are added to the dict based on our usage of vars in test but we could remove them later by doing minor test updates. They are intentionally not fixed in this commit to limit scope creep. Change-Id: Iacfbb0a5dc8ffb0857219c8d7c7a7d6e188f5980 --- doc/dictionary.txt | 5 ++++- nova/compute/api.py | 2 +- nova/tests/fixtures/cinder.py | 2 +- nova/tests/fixtures/libvirt.py | 2 +- nova/tests/fixtures/notifications.py | 2 +- nova/tests/fixtures/nova.py | 4 ++-- nova/tests/fixtures/os_brick.py | 2 +- .../tests/functional/compute/test_instance_list.py | 2 +- nova/tests/functional/db/test_archive.py | 2 +- nova/tests/functional/libvirt/base.py | 6 +++--- .../functional/libvirt/test_numa_live_migration.py | 2 +- nova/tests/functional/libvirt/test_numa_servers.py | 2 +- .../functional/libvirt/test_pci_in_placement.py | 2 +- .../functional/libvirt/test_pci_sriov_servers.py | 10 +++++----- nova/tests/functional/libvirt/test_power_manage.py | 6 +++--- .../functional/regressions/test_bug_1922053.py | 2 +- nova/tests/functional/test_policy.py | 2 +- .../tests/functional/test_servers_provider_tree.py | 2 +- .../validate_provider_bad_config.yaml | 4 ++-- nova/tests/unit/compute/test_api.py | 6 +++--- nova/tests/unit/compute/test_compute.py | 14 +++++++------- nova/tests/unit/compute/test_compute_mgr.py | 8 ++++---- .../unit/conductor/tasks/test_live_migrate.py | 2 +- nova/tests/unit/db/main/test_api.py | 6 +++--- nova/tests/unit/fixtures/test_libvirt.py | 2 +- nova/tests/unit/image/test_glance.py | 4 ++-- nova/tests/unit/policies/base.py | 2 +- nova/tests/unit/policies/test_attach_interfaces.py | 2 +- nova/tests/unit/policies/test_instance_actions.py | 2 +- nova/tests/unit/policies/test_server_topology.py | 2 +- nova/tests/unit/virt/libvirt/test_driver.py | 14 +++++++------- nova/tests/unit/virt/test_block_device.py | 4 ++-- nova/tests/unit/virt/vmwareapi/test_images.py | 2 +- nova/tests/unit/virt/vmwareapi/test_vm_util.py | 2 +- 34 files changed, 68 insertions(+), 65 deletions(-) diff --git a/doc/dictionary.txt b/doc/dictionary.txt index 0dc9142cdb..21ad5453d0 100644 --- a/doc/dictionary.txt +++ b/doc/dictionary.txt @@ -6,4 +6,7 @@ deques affinitized noes wile -usera \ No newline at end of file +usera +dettach +excpt +imigration \ No newline at end of file diff --git a/nova/compute/api.py b/nova/compute/api.py index d64432327e..f067bbfc38 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -1030,7 +1030,7 @@ class API: context, ['nova-compute'])) if min_version < SUPPORT_VNIC_TYPE_ACCELERATOR: - msg = ("Port with cyborg profile is not avaliable" + msg = ("Port with cyborg profile is not available" " until upgrade finished.") raise exception.ForbiddenPortsWithAccelerator(msg) diff --git a/nova/tests/fixtures/cinder.py b/nova/tests/fixtures/cinder.py index d4a0b36e49..0ae7df38d8 100644 --- a/nova/tests/fixtures/cinder.py +++ b/nova/tests/fixtures/cinder.py @@ -254,7 +254,7 @@ class CinderFixture(fixtures.Fixture): 'attach_status': 'attached', 'attachments': attachments, }) - # Otherwise mark the volume as avilable and detached + # Otherwise mark the volume as available and detached else: volume.update({ 'status': 'available', diff --git a/nova/tests/fixtures/libvirt.py b/nova/tests/fixtures/libvirt.py index 4f48463118..d7bfa2187b 100644 --- a/nova/tests/fixtures/libvirt.py +++ b/nova/tests/fixtures/libvirt.py @@ -925,7 +925,7 @@ def disable_event_thread(self): problematic because it means we've got a floating thread calling sleep(1) over the life of the unit test. Seems harmless? It's not, because we sometimes want to test things like retry loops that - should have specific sleep paterns. An unlucky firing of the + should have specific sleep patterns. An unlucky firing of the libvirt thread will cause a test failure. """ diff --git a/nova/tests/fixtures/notifications.py b/nova/tests/fixtures/notifications.py index 817982d4ff..d550acb056 100644 --- a/nova/tests/fixtures/notifications.py +++ b/nova/tests/fixtures/notifications.py @@ -53,7 +53,7 @@ class _Sub(object): # notifications = pprint.pformat( # {event: sub._notifications # for event, sub in VERSIONED_SUBS.items()}) - # FIXME: tranform this to get access to all the + # FIXME: transform this to get access to all the # versioned notifications notifications = [] raise AssertionError( diff --git a/nova/tests/fixtures/nova.py b/nova/tests/fixtures/nova.py index ae2e7d70ef..6f1845e8af 100644 --- a/nova/tests/fixtures/nova.py +++ b/nova/tests/fixtures/nova.py @@ -990,7 +990,7 @@ class OSAPIFixture(fixtures.Fixture): loader = wsgi.Loader().load_app(service_name) app = lambda: loader - # re-use service setup code from wsgi_app to register + # reuse service setup code from wsgi_app to register # service, which is looked for in some tests wsgi_app._setup_service(CONF.host, service_name) intercept = interceptor.RequestsInterceptor(app, url=endpoint) @@ -1523,7 +1523,7 @@ class DownCellFixture(fixtures.Fixture): def wrap(cell_uuid, thing): # We should embed the cell_uuid into the context before - # wrapping since its used to calcualte the cells_timed_out and + # wrapping since its used to calculate the cells_timed_out and # cells_failed properties in the object. ctxt.cell_uuid = cell_uuid return multi_cell_list.RecordWrapper(ctxt, sort_ctx, thing) diff --git a/nova/tests/fixtures/os_brick.py b/nova/tests/fixtures/os_brick.py index 2062e8ed14..171ff5f140 100644 --- a/nova/tests/fixtures/os_brick.py +++ b/nova/tests/fixtures/os_brick.py @@ -36,7 +36,7 @@ def get_connector_properties( class ISCSIConnector(object): - """Mimick the iSCSI connector.""" + """Mimic the iSCSI connector.""" def __init__( self, root_helper, driver=None, execute=None, use_multipath=False, diff --git a/nova/tests/functional/compute/test_instance_list.py b/nova/tests/functional/compute/test_instance_list.py index 8a63102764..4f8de2f158 100644 --- a/nova/tests/functional/compute/test_instance_list.py +++ b/nova/tests/functional/compute/test_instance_list.py @@ -162,7 +162,7 @@ class InstanceListTestCase(test.TestCase): This requests $pages of $pagesize, followed by a final page with no limit, and a final-final page which should be empty. It validates - that we got a consistent set of results no patter where the page + that we got a consistent set of results no pattern where the page boundary is, that we got all the results after the unlimited query, and that the final page comes back empty when we use the last instance as a marker. diff --git a/nova/tests/functional/db/test_archive.py b/nova/tests/functional/db/test_archive.py index 1bcce9f3ee..464a596721 100644 --- a/nova/tests/functional/db/test_archive.py +++ b/nova/tests/functional/db/test_archive.py @@ -190,7 +190,7 @@ class TestDatabaseArchive(integrated_helpers._IntegratedTestBase): And when the operator has e.g. 500,000 deleted instances rows (and millions of deleted rows total) they are trying to archive, being - forced to use a max_rows value serveral orders of magnitude lower than + forced to use a max_rows value several orders of magnitude lower than the number of rows they need to archive was a poor user experience. This tests that we are archiving each parent plus their child rows one diff --git a/nova/tests/functional/libvirt/base.py b/nova/tests/functional/libvirt/base.py index 1ee46a3217..603e3b50a9 100644 --- a/nova/tests/functional/libvirt/base.py +++ b/nova/tests/functional/libvirt/base.py @@ -128,9 +128,9 @@ class ServersTestBase(integrated_helpers._IntegratedTestBase): core, and 16GB of RAM. :param connection: A fake libvirt connection. You should not provide it directly. However it is used by restart_compute_service to - implement restart without loosing the hypervisor state. + implement restart without losing the hypervisor state. :returns: The hostname of the created service, which can be used to - lookup the created service and UUID of the assocaited resource + lookup the created service and UUID of the associated resource provider. """ if connection and ( @@ -264,7 +264,7 @@ class ServersTestBase(integrated_helpers._IntegratedTestBase): class LibvirtMigrationMixin(object): """A simple mixin to facilliate successful libvirt live migrations - Requires that the test class set self.server for the specific test instnace + Requires that the test class set self.server for the specific test instance and self.{src,dest} to indicate the direction of the migration. For any scenarios more complex than this they should override _migrate_stub with their own implementation. diff --git a/nova/tests/functional/libvirt/test_numa_live_migration.py b/nova/tests/functional/libvirt/test_numa_live_migration.py index 0e504d2df2..27dd3255c5 100644 --- a/nova/tests/functional/libvirt/test_numa_live_migration.py +++ b/nova/tests/functional/libvirt/test_numa_live_migration.py @@ -141,7 +141,7 @@ class NUMALiveMigrationPositiveBase(NUMALiveMigrationBase): class NUMALiveMigrationPositiveTests(NUMALiveMigrationPositiveBase): """Tests that expect the live migration to succeed. Stubs out fakelibvirt's - migrateToURI3() with a stub that "suceeds" the migration. + migrateToURI3() with a stub that "succeeds" the migration. """ def _migrate_stub(self, domain, destination, params, flags): diff --git a/nova/tests/functional/libvirt/test_numa_servers.py b/nova/tests/functional/libvirt/test_numa_servers.py index 5b73e1b965..ce34bbc82e 100644 --- a/nova/tests/functional/libvirt/test_numa_servers.py +++ b/nova/tests/functional/libvirt/test_numa_servers.py @@ -849,7 +849,7 @@ class NUMAServersTest(NUMAServersTestBase): self.assertEqual(2, len(src_numa_topology.cells[0].pinned_cpus)) self.assertEqual(2, len(dst_numa_topology.cells[0].pinned_cpus)) - # before continuing with the actualy confirm process + # before continuing with the actually confirm process return orig_confirm(*args, **kwargs) self.stub_out( diff --git a/nova/tests/functional/libvirt/test_pci_in_placement.py b/nova/tests/functional/libvirt/test_pci_in_placement.py index 41d6c8e008..c5935da778 100644 --- a/nova/tests/functional/libvirt/test_pci_in_placement.py +++ b/nova/tests/functional/libvirt/test_pci_in_placement.py @@ -1419,7 +1419,7 @@ class PlacementPCIAllocationHealingTests(PlacementPCIReportingTests): # * one type-PFs (slot 2) with 1 type-VFs compute2_pci_info = fakelibvirt.HostPCIDevicesInfo( num_pci=2, num_pfs=1, num_vfs=1) - # the config matches the PCI devs and hte PF but not the VFs + # the config matches the PCI devs and the PF but not the VFs compute2_device_spec = self._to_list_of_json_str( [ { diff --git a/nova/tests/functional/libvirt/test_pci_sriov_servers.py b/nova/tests/functional/libvirt/test_pci_sriov_servers.py index 190fe73517..f5a97df5b9 100644 --- a/nova/tests/functional/libvirt/test_pci_sriov_servers.py +++ b/nova/tests/functional/libvirt/test_pci_sriov_servers.py @@ -1132,7 +1132,7 @@ class SRIOVServersTest(_PCIServersWithMigrationTestBase): pci_info = fakelibvirt.HostPCIDevicesInfo(num_pfs=1, num_vfs=1) pci_info_no_sriov = copy.deepcopy(pci_info) - # Disable SRIOV capabilties in PF and delete the VFs + # Disable SRIOV capabilities in PF and delete the VFs self._disable_sriov_in_pf(pci_info_no_sriov) self.start_compute('test_compute0', pci_info=pci_info_no_sriov) @@ -1178,7 +1178,7 @@ class SRIOVServersTest(_PCIServersWithMigrationTestBase): As the vnic_type is changed on the port but the vif_type is hwveb instead of macvtap the vif plug logic will try to look up the netdev - of the parent VF. Howvere that VF consumed by the instance so the + of the parent VF. However that VF consumed by the instance so the netdev does not exists. This causes that the compute service will fail with an exception during startup """ @@ -1750,7 +1750,7 @@ class VDPAServersTest(_PCIServersWithMigrationTestBase): # 1 PF and 2 VFs . self.assertPCIDeviceCounts(source, total=num_pci, free=num_pci - 3) server = self._confirm_resize(server) - # but once we confrim it should be reduced back to 1 PF and 1 VF + # but once we confirm it should be reduced back to 1 PF and 1 VF self.assertPCIDeviceCounts(source, total=num_pci, free=num_pci - 2) # assert the hostname has not have changed as part # of the resize. @@ -1849,7 +1849,7 @@ class VDPAServersTest(_PCIServersWithMigrationTestBase): self.assertPCIDeviceCounts(source, total=num_pci, free=num_pci - 2) # enable the dest we do not need to disable the source since cold - # migrate wont happen to the same host in the libvirt driver + # migrate won't happen to the same host in the libvirt driver self.api.put_service( self.computes['dest'].service_ref.uuid, {'status': 'enabled'}) with mock.patch( @@ -1918,7 +1918,7 @@ class VDPAServersTest(_PCIServersWithMigrationTestBase): self.assertPCIDeviceCounts(source, total=num_pci, free=num_pci - 2) # enable the dest we do not need to disable the source since cold - # migrate wont happen to the same host in the libvirt driver + # migrate won't happen to the same host in the libvirt driver self.api.put_service( self.computes['dest'].service_ref.uuid, {'status': 'enabled'}) diff --git a/nova/tests/functional/libvirt/test_power_manage.py b/nova/tests/functional/libvirt/test_power_manage.py index 9f80446bd6..a64c61dfbd 100644 --- a/nova/tests/functional/libvirt/test_power_manage.py +++ b/nova/tests/functional/libvirt/test_power_manage.py @@ -92,7 +92,7 @@ class PowerManagementTests(PowerManagementTestsBase): self.useFixture(nova_fixtures.SysFileSystemFixture()) - # Definining the CPUs to be pinned. + # Defining the CPUs to be pinned. self.flags(cpu_dedicated_set='1-9', cpu_shared_set=None, group='compute') self.flags(vcpu_pin_set=None) @@ -184,7 +184,7 @@ class PowerManagementTestsGovernor(PowerManagementTestsBase): self.useFixture(nova_fixtures.SysFileSystemFixture()) - # Definining the CPUs to be pinned. + # Defining the CPUs to be pinned. self.flags(cpu_dedicated_set='1-9', cpu_shared_set=None, group='compute') self.flags(vcpu_pin_set=None) @@ -231,7 +231,7 @@ class PowerManagementMixedInstances(PowerManagementTestsBase): self.useFixture(nova_fixtures.SysFileSystemFixture()) - # Definining 6 CPUs to be dedicated, not all of them in a series. + # Defining 6 CPUs to be dedicated, not all of them in a series. self.flags(cpu_dedicated_set='1-3,5-7', cpu_shared_set='4,8-9', group='compute') self.flags(vcpu_pin_set=None) diff --git a/nova/tests/functional/regressions/test_bug_1922053.py b/nova/tests/functional/regressions/test_bug_1922053.py index 70bb3d4cab..90c1088aed 100644 --- a/nova/tests/functional/regressions/test_bug_1922053.py +++ b/nova/tests/functional/regressions/test_bug_1922053.py @@ -92,7 +92,7 @@ class ForceUpWithDoneEvacuationsv252(ForceUpWithDoneEvacuations): """Regression test for bug 1922053 using microversion 2.52. Required as the PUT /os-services/force-down API used by this test via - self.api.force_down_service is superseeded by PUT /os-services/{service_id} + self.api.force_down_service is superseded by PUT /os-services/{service_id} API used by our parent ForceUpWithDoneEvacuations class from >=2.53. This test also uses the 'availability_zone' parameter to force the server diff --git a/nova/tests/functional/test_policy.py b/nova/tests/functional/test_policy.py index bb72915336..2af602c892 100644 --- a/nova/tests/functional/test_policy.py +++ b/nova/tests/functional/test_policy.py @@ -130,7 +130,7 @@ class HostStatusPolicyTestCase(test.TestCase, # Verify non-admin do not receive the host_status field. self.assertNotIn('host_status', server) self._set_server_state_active(server) - # Verify that admin will not receive ths host_status field if the + # Verify that admin will not receive the host_status field if the # API microversion < 2.16. with utils.temporary_mutation(self.admin_api, microversion='2.15'): server = self._get_server(admin_func(*args)) diff --git a/nova/tests/functional/test_servers_provider_tree.py b/nova/tests/functional/test_servers_provider_tree.py index 625ca97c53..aa57255808 100644 --- a/nova/tests/functional/test_servers_provider_tree.py +++ b/nova/tests/functional/test_servers_provider_tree.py @@ -58,7 +58,7 @@ class ProviderTreeTests(integrated_helpers.ProviderUsageBaseTestCase): # Start compute without mocking update_provider_tree. The fake driver # doesn't implement the method, so this will cause us to start with the # legacy get_available_resource()-based inventory discovery and - # boostrapping of placement data. + # bootstrapping of placement data. self.compute = self._start_compute(host='host1') # Mock out update_provider_tree *after* starting compute with the diff --git a/nova/tests/unit/compute/provider_config_data/validate_provider_bad_config.yaml b/nova/tests/unit/compute/provider_config_data/validate_provider_bad_config.yaml index b81ca5d584..e0092ade31 100644 --- a/nova/tests/unit/compute/provider_config_data/validate_provider_bad_config.yaml +++ b/nova/tests/unit/compute/provider_config_data/validate_provider_bad_config.yaml @@ -11,9 +11,9 @@ # under the License. # This file contains ddt test data consumed by test_provider_config.py to test -# bad provider configrations through _validate_provider_config(). +# bad provider configurations through _validate_provider_config(). # Sample is required for each test and passed to _validate_provider_config(). -# If excpetion is raised with expected message, the test passes. +# If exception is raised with expected message, the test passes. one_invalid_additional_inventory: sample: providers: diff --git a/nova/tests/unit/compute/test_api.py b/nova/tests/unit/compute/test_api.py index c2b1f876cd..01afe5ebe1 100644 --- a/nova/tests/unit/compute/test_api.py +++ b/nova/tests/unit/compute/test_api.py @@ -7165,7 +7165,7 @@ class _ComputeAPIUnitTestMixIn(object): @mock.patch.object(objects.BuildRequest, 'get_by_instance_uuid') def test_update_future_instance_with_buildreq(self, mock_buildreq_get): - # This test checks that a new instance which is not yet peristed in + # This test checks that a new instance which is not yet persisted in # DB can be found by looking up the BuildRequest object so we can # update it. @@ -7547,7 +7547,7 @@ class ComputeAPIUnitTestCase(_ComputeAPIUnitTestMixIn, test.NoDBTestCase): new_callable=mock.PropertyMock(return_value=old_image_meta)): # The old image has a NUMA topology defined but the new image # used to rebuild does not. This would alter the NUMA constrains - # and therefor should raise. + # and therefore should raise. self.assertRaises( exception.ImageNUMATopologyRebuildConflict, self.compute_api._validate_numa_rebuild, instance, @@ -7605,7 +7605,7 @@ class ComputeAPIUnitTestCase(_ComputeAPIUnitTestMixIn, test.NoDBTestCase): requested_networks = objects.NetworkRequestList( objects=[objects.NetworkRequest(device_profile='smartnic1')]) self.assertRaisesRegex(exception.ForbiddenPortsWithAccelerator, - 'Port with cyborg profile is not avaliable until upgrade' + 'Port with cyborg profile is not available until upgrade' ' finished.', self.compute_api._check_support_vnic_accelerator, self.context, diff --git a/nova/tests/unit/compute/test_compute.py b/nova/tests/unit/compute/test_compute.py index f63082d951..ea88d5af86 100644 --- a/nova/tests/unit/compute/test_compute.py +++ b/nova/tests/unit/compute/test_compute.py @@ -1667,10 +1667,10 @@ class ComputeTestCase(BaseTestCase, did_it_add_fault) @compute_manager.wrap_instance_fault - def failer(self2, context, instance): + def failure(self2, context, instance): raise NotImplementedError() - self.assertRaises(NotImplementedError, failer, + self.assertRaises(NotImplementedError, failure, self.compute, self.context, instance=inst) self.assertTrue(called['fault_added']) @@ -1687,10 +1687,10 @@ class ComputeTestCase(BaseTestCase, did_it_add_fault) @compute_manager.wrap_instance_fault - def failer(self2, context, instance): + def failure(self2, context, instance): raise NotImplementedError() - self.assertRaises(NotImplementedError, failer, + self.assertRaises(NotImplementedError, failure, self.compute, self.context, inst) self.assertTrue(called['fault_added']) @@ -1707,10 +1707,10 @@ class ComputeTestCase(BaseTestCase, did_it_add_fault) @compute_manager.wrap_instance_fault - def failer(self2, context, instance): + def failure(self2, context, instance): raise exception.InstanceNotFound(instance_id=instance['uuid']) - self.assertRaises(exception.InstanceNotFound, failer, + self.assertRaises(exception.InstanceNotFound, failure, self.compute, self.context, inst) self.assertFalse(called['fault_added']) @@ -5904,7 +5904,7 @@ class ComputeTestCase(BaseTestCase, updated_topology = objects.NUMATopology.obj_from_primitive( jsonutils.loads(cn.numa_topology)) - # after confirming resize all cpus on currect host must be free + # after confirming resize all cpus on current host must be free self.assertEqual(2, len(updated_topology.cells)) for cell in updated_topology.cells: self.assertEqual(set(), cell.pinned_cpus) diff --git a/nova/tests/unit/compute/test_compute_mgr.py b/nova/tests/unit/compute/test_compute_mgr.py index 335f5d5afc..6425d3cbe7 100644 --- a/nova/tests/unit/compute/test_compute_mgr.py +++ b/nova/tests/unit/compute/test_compute_mgr.py @@ -4620,7 +4620,7 @@ class ComputeManagerUnitTestCase(test.NoDBTestCase, mock_notify_attach_detach, notify_inst_usage, expected=None): - """Re-usable code for detach volume evacuate test cases. + """Reusable code for detach volume evacuate test cases. :param conn_info_str: String form of the stashed connector. :param expected: Dict of the connector that is expected in the @@ -7893,7 +7893,7 @@ class ComputeManagerBuildInstanceTestCase(test.NoDBTestCase): def test_build_and_run_no_more_fixedips_exception(self): self._test_build_and_run_spawn_exceptions( - exception.NoMoreFixedIps("error messge")) + exception.NoMoreFixedIps("error message")) def test_build_and_run_flavor_disk_smaller_image_exception(self): self._test_build_and_run_spawn_exceptions( @@ -8408,7 +8408,7 @@ class ComputeManagerBuildInstanceTestCase(test.NoDBTestCase): self.block_device_mapping, self.requested_networks, try_deallocate_networks=False) mock_prepspawn.assert_called_once_with(self.instance) - # Complete should have occured with _shutdown_instance + # Complete should have occurred with _shutdown_instance # so calling after the fact is not necessary. mock_failedspawn.assert_not_called() @@ -8538,7 +8538,7 @@ class ComputeManagerBuildInstanceTestCase(test.NoDBTestCase): self.block_device_mapping, self.requested_networks, try_deallocate_networks=False) mock_prepspawn.assert_called_once_with(self.instance) - # Complete should have occured with _shutdown_instance + # Complete should have occurred with _shutdown_instance # so calling after the fact is not necessary. mock_failedspawn.assert_not_called() diff --git a/nova/tests/unit/conductor/tasks/test_live_migrate.py b/nova/tests/unit/conductor/tasks/test_live_migrate.py index 4e888139f6..02a2530b7a 100644 --- a/nova/tests/unit/conductor/tasks/test_live_migrate.py +++ b/nova/tests/unit/conductor/tasks/test_live_migrate.py @@ -858,7 +858,7 @@ class LiveMigrationTaskTestCase(test.NoDBTestCase): supp_binding_ext_retval self.task.instance.pci_requests = instance_pci_reqs self.task._check_can_migrate_pci("Src", "Dst") - # in case we managed to get away without rasing, check mocks + # in case we managed to get away without raising, check mocks if instance_pci_reqs: mock_supp_port_binding_ext.assert_called_once_with( self.context) diff --git a/nova/tests/unit/db/main/test_api.py b/nova/tests/unit/db/main/test_api.py index 9f7f837f9f..71e7e87505 100644 --- a/nova/tests/unit/db/main/test_api.py +++ b/nova/tests/unit/db/main/test_api.py @@ -2312,12 +2312,12 @@ class InstanceTestCase(test.TestCase, ModelsObjectComparatorMixin): ]) def test_instance_update_and_get_original_conflict_race_fallthrough(self): - # Ensure that is update_match continuously fails for no discernable + # Ensure that is update_match continuously fails for no discernible # reason, we evantually raise UnknownInstanceUpdateConflict instance = self.create_instance_with_args() # Reproduce the conditions of a race between fetching and updating the - # instance by making update_on_match fail for no discernable reason. + # instance by making update_on_match fail for no discernible reason. with mock.patch.object(update_match, 'update_on_match', side_effect=update_match.NoRowsMatched): self.assertRaises(exception.UnknownInstanceUpdateConflict, @@ -2669,7 +2669,7 @@ class InstanceTestCase(test.TestCase, ModelsObjectComparatorMixin): block_dev = block_device.BlockDeviceDict(bdm_values) db.block_device_mapping_create(self.ctxt, block_dev, legacy=False) - # Crate a second BDM that is soft-deleted to simulate that the + # Create a second BDM that is soft-deleted to simulate that the # volume was detached and the BDM was deleted before the instance # was hard destroyed. bdm2_values = { diff --git a/nova/tests/unit/fixtures/test_libvirt.py b/nova/tests/unit/fixtures/test_libvirt.py index 448f8f6720..d5be81af43 100644 --- a/nova/tests/unit/fixtures/test_libvirt.py +++ b/nova/tests/unit/fixtures/test_libvirt.py @@ -206,7 +206,7 @@ class FakeLibvirtTests(test.NoDBTestCase): self.assertFalse(dom.isActive(), 'Defined domain was running.') dom.createWithFlags(0) self.assertTrue(dom.isActive(), - 'Domain wasn\'t running after createWithFlags') + "Domain wasn't running after createWithFlags") def test_managedSave(self): uuid = uuidutils.generate_uuid() diff --git a/nova/tests/unit/image/test_glance.py b/nova/tests/unit/image/test_glance.py index 935a271d44..200602b057 100644 --- a/nova/tests/unit/image/test_glance.py +++ b/nova/tests/unit/image/test_glance.py @@ -788,7 +788,7 @@ class TestDownloadNoDirectUri(test.NoDBTestCase): show_mock.return_value = { 'locations': [ { - 'url': 'rbd://cluser/pool/image/snapshot', + 'url': 'rbd://cluster/pool/image/snapshot', 'metadata': mock.sentinel.loc_meta } ] @@ -843,7 +843,7 @@ class TestDownloadNoDirectUri(test.NoDBTestCase): show_mock.return_value = { 'locations': [ { - 'url': 'funky://cluser/pool/image/snapshot', + 'url': 'funky://cluster/pool/image/snapshot', 'metadata': mock.sentinel.loc_meta } ] diff --git a/nova/tests/unit/policies/base.py b/nova/tests/unit/policies/base.py index 7490441d92..caa3fd11e4 100644 --- a/nova/tests/unit/policies/base.py +++ b/nova/tests/unit/policies/base.py @@ -144,7 +144,7 @@ class BasePolicyTest(test.TestCase): self.system_admin_context, self.system_foo_context, self.system_member_context, self.system_reader_context, ]) - # A few commmon set of contexts to be used in tests + # A few common set of contexts to be used in tests # # With scope disable and no legacy rule, any admin, # project members have access. No other role in that project diff --git a/nova/tests/unit/policies/test_attach_interfaces.py b/nova/tests/unit/policies/test_attach_interfaces.py index 33c531c9c7..c8880df148 100644 --- a/nova/tests/unit/policies/test_attach_interfaces.py +++ b/nova/tests/unit/policies/test_attach_interfaces.py @@ -171,7 +171,7 @@ class AttachInterfacesDeprecatedPolicyTest(base.BasePolicyTest): self.reader_req = fakes.HTTPRequest.blank('') self.reader_req.environ['nova.context'] = self.project_reader_context self.deprecated_policy = "os_compute_api:os-attach-interfaces" - # Overridde rule with different checks than defaults so that we can + # Override rule with different checks than defaults so that we can # verify the rule overridden case. override_rules = {self.deprecated_policy: base_policy.RULE_ADMIN_API} # NOTE(gmann): Only override the deprecated rule in policy file so diff --git a/nova/tests/unit/policies/test_instance_actions.py b/nova/tests/unit/policies/test_instance_actions.py index 1ca9a66c14..7b63bb8546 100644 --- a/nova/tests/unit/policies/test_instance_actions.py +++ b/nova/tests/unit/policies/test_instance_actions.py @@ -171,7 +171,7 @@ class InstanceActionsDeprecatedPolicyTest(base.BasePolicyTest): self.reader_req = fakes.HTTPRequest.blank('') self.reader_req.environ['nova.context'] = self.project_reader_context self.deprecated_policy = ia_policies.ROOT_POLICY - # Overridde rule with different checks than defaults so that we can + # Override rule with different checks than defaults so that we can # verify the rule overridden case. override_rules = { self.deprecated_policy: base_policy.RULE_ADMIN_OR_OWNER, diff --git a/nova/tests/unit/policies/test_server_topology.py b/nova/tests/unit/policies/test_server_topology.py index e2f81dfaad..39896e516a 100644 --- a/nova/tests/unit/policies/test_server_topology.py +++ b/nova/tests/unit/policies/test_server_topology.py @@ -52,7 +52,7 @@ class ServerTopologyPolicyTest(base.BasePolicyTest): # Check that system reader or and server owner is able to get # the server topology. # With legacy rule and no scope checks, all admin is able to get - # server topology wth host info. + # server topology with host info. self.project_admin_authorized_contexts = [ self.legacy_admin_context, self.system_admin_context, self.project_admin_context] diff --git a/nova/tests/unit/virt/libvirt/test_driver.py b/nova/tests/unit/virt/libvirt/test_driver.py index baabe14487..a0ce273e9d 100644 --- a/nova/tests/unit/virt/libvirt/test_driver.py +++ b/nova/tests/unit/virt/libvirt/test_driver.py @@ -22794,7 +22794,7 @@ class LibvirtDriverTestCase(test.NoDBTestCase, TraitsComparisonMixin): mock_get_disk_info): # Check error on resize root disk down for rbd. # The difference is that get_instance_disk_info always returns - # an emply list for rbd. + # an empty list for rbd. # Ephemeral size is not changed in this case (otherwise other check # will raise the same error). self.flags(images_type='rbd', group='libvirt') @@ -24044,7 +24044,7 @@ class LibvirtDriverTestCase(test.NoDBTestCase, TraitsComparisonMixin): ] self._test_inject_data(instance, injection_info, "/path", disk_params) - # Test with the configuration setted to false. + # Test with the configuration set to false. self.flags(inject_password=False, group='libvirt') self._test_inject_data(instance, injection_info, "/path", disk_params, called=False) @@ -24064,7 +24064,7 @@ class LibvirtDriverTestCase(test.NoDBTestCase, TraitsComparisonMixin): self._test_inject_data(instance, injection_info, "/path", disk_params) - # Test with the configuration setted to false. + # Test with the configuration set to false. self.flags(inject_key=False, group='libvirt') self._test_inject_data(instance, injection_info, "/path", disk_params, called=False) @@ -24895,8 +24895,8 @@ class LibvirtDriverTestCase(test.NoDBTestCase, TraitsComparisonMixin): ) # By mocking threading.Event.wait we prevent the test to wait until the # timeout happens, and by returning False first we simulate to the - # caller that the wait returned not becasuse the event is set but - # because timeout happend. Then during the retry we return True + # caller that the wait returned not because the event is set but + # because timeout happened. Then during the retry we return True # signalling that the event is set, i.e. the libvirt event the caller # is waiting for has been received mock_event_wait.side_effect = [False, True] @@ -25023,8 +25023,8 @@ class LibvirtDriverTestCase(test.NoDBTestCase, TraitsComparisonMixin): # By mocking threading.Event.wait we prevent the test to wait until the # timeout happens, and by returning False we simulate to the - # caller that the wait returned not becasuse the event is set but - # because timeout happend. + # caller that the wait returned not because the event is set but + # because timeout happened. mock_event_wait.return_value = False self.assertRaises( diff --git a/nova/tests/unit/virt/test_block_device.py b/nova/tests/unit/virt/test_block_device.py index 703f15967c..3357d1bc02 100644 --- a/nova/tests/unit/virt/test_block_device.py +++ b/nova/tests/unit/virt/test_block_device.py @@ -1049,7 +1049,7 @@ class TestDriverBlockDevice(test.NoDBTestCase): self.assertEqual('fake-volume-id-2', test_bdm.volume_id) mock_attach.assert_called_once_with( self.context, instance, self.volume_api, self.virt_driver) - # Make sure theses are not called + # Make sure these are not called self.volume_api.get_snapshot.assert_not_called() self.volume_api.create.assert_not_called() @@ -1182,7 +1182,7 @@ class TestDriverBlockDevice(test.NoDBTestCase): self.assertEqual('fake-volume-id-2', test_bdm.volume_id) mock_attach.assert_called_once_with( self.context, instance, self.volume_api, self.virt_driver) - # Make sure theses are not called + # Make sure these are not called self.volume_api.get_snapshot.assert_not_called() self.volume_api.create.assert_not_called() diff --git a/nova/tests/unit/virt/vmwareapi/test_images.py b/nova/tests/unit/virt/vmwareapi/test_images.py index 20abc063a0..f3fff83d90 100644 --- a/nova/tests/unit/virt/vmwareapi/test_images.py +++ b/nova/tests/unit/virt/vmwareapi/test_images.py @@ -337,7 +337,7 @@ class VMwareImagesTestCase(test.NoDBTestCase): def test_image_defaults(self): image = images.VMwareImage(image_id='fake-image-id') - # N.B. We intentially don't use the defined constants here. Amongst + # N.B. We intentionally don't use the defined constants here. Amongst # other potential failures, we're interested in changes to their # values, which would not otherwise be picked up. self.assertEqual('otherGuest', image.os_type) diff --git a/nova/tests/unit/virt/vmwareapi/test_vm_util.py b/nova/tests/unit/virt/vmwareapi/test_vm_util.py index 82fa07a882..37de5d85c4 100644 --- a/nova/tests/unit/virt/vmwareapi/test_vm_util.py +++ b/nova/tests/unit/virt/vmwareapi/test_vm_util.py @@ -1025,7 +1025,7 @@ class VMwareVMUtilTestCase(test.NoDBTestCase): """Ensure we warn when create_vm() fails after we passed an unrecognised guestId """ - # avoid real sleeps during test due to te retry decorator on create_vm + # avoid real sleeps during test due to the retry decorator on create_vm self.useFixture(oslo_svc_fixture.SleepFixture()) found = [False]