diff options
author | Zuul <zuul@review.opendev.org> | 2022-12-05 17:03:52 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2022-12-05 17:03:52 +0000 |
commit | 2561237c9f295daf988307d5361a7e1075e7cf0a (patch) | |
tree | 64e0ef18e1187d7216dce081710817255ac0866f /nova/tests | |
parent | 2d65da72e14cfd3a11dc134e7a0269d230a7427c (diff) | |
parent | e7c2e55c6685ccda23ad5c020db5b204f82d296e (diff) | |
download | nova-2561237c9f295daf988307d5361a7e1075e7cf0a.tar.gz |
Merge "refactor: remove duplicated logic" into stable/xena
Diffstat (limited to 'nova/tests')
-rw-r--r-- | nova/tests/unit/network/test_neutron.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/nova/tests/unit/network/test_neutron.py b/nova/tests/unit/network/test_neutron.py index 0d6e84c505..75a2e5ad78 100644 --- a/nova/tests/unit/network/test_neutron.py +++ b/nova/tests/unit/network/test_neutron.py @@ -7085,7 +7085,7 @@ class TestAPI(TestAPIBase): self.context, uuids.subnet_id) @mock.patch.object(neutronapi.LOG, 'debug') - def test_get_port_pci_slot(self, mock_debug): + def test_get_port_pci_dev(self, mock_debug): fake_port = {'id': uuids.fake_port_id} request = objects.InstancePCIRequest(requester_id=uuids.fake_port_id, request_id=uuids.pci_request_id) @@ -7100,13 +7100,14 @@ class TestAPI(TestAPIBase): pci_devices=objects.PciDeviceList(objects=[device])) self.assertEqual( 'fake-pci-address', - self.api._get_port_pci_slot(self.context, instance, fake_port)) + self.api._get_port_pci_dev( + self.context, instance, fake_port).address) # Test not finding the request instance = objects.Instance( pci_requests=objects.InstancePCIRequests( requests=[objects.InstancePCIRequest(bad_request)])) self.assertIsNone( - self.api._get_port_pci_slot(self.context, instance, fake_port)) + self.api._get_port_pci_dev(self.context, instance, fake_port)) mock_debug.assert_called_with('No PCI request found for port %s', uuids.fake_port_id, instance=instance) mock_debug.reset_mock() @@ -7115,7 +7116,7 @@ class TestAPI(TestAPIBase): pci_requests=objects.InstancePCIRequests(requests=[request]), pci_devices=objects.PciDeviceList(objects=[bad_device])) self.assertIsNone( - self.api._get_port_pci_slot(self.context, instance, fake_port)) + self.api._get_port_pci_dev(self.context, instance, fake_port)) mock_debug.assert_called_with('No PCI device found for request %s', uuids.pci_request_id, instance=instance) |