diff --git a/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py b/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py index d8dd778e906..24c5a58afc8 100644 --- a/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py +++ b/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py @@ -166,7 +166,7 @@ class TestOvsNeutronAgent(object): mock.patch('oslo_service.loopingcall.FixedIntervalLoopingCall', new=MockFixedIntervalLoopingCall),\ mock.patch( - 'neutron.agent.common.ovs_lib.OVSBridge.' 'get_vif_ports', + 'neutron.agent.common.ovs_lib.OVSBridge.get_vif_ports', return_value=[]),\ mock.patch('neutron.agent.rpc.PluginReportStateAPI.' 'has_alive_neutron_server'): @@ -241,7 +241,7 @@ class TestOvsNeutronAgent(object): mock.patch('oslo_service.loopingcall.FixedIntervalLoopingCall', new=MockFixedIntervalLoopingCall), \ mock.patch( - 'neutron.agent.common.ovs_lib.OVSBridge.' 'get_vif_ports', + 'neutron.agent.common.ovs_lib.OVSBridge.get_vif_ports', return_value=[]), \ mock.patch('neutron.agent.common.ovs_lib.BaseOVS.config', new_callable=mock.PropertyMock, @@ -3102,7 +3102,7 @@ class AncillaryBridgesTest(object): 'get_ports_attributes', return_value=[]),\ mock.patch( - 'neutron.agent.common.ovs_lib.OVSBridge.' 'get_vif_ports', + 'neutron.agent.common.ovs_lib.OVSBridge.get_vif_ports', return_value=[]),\ mock.patch('neutron.agent.rpc.PluginReportStateAPI.' 'has_alive_neutron_server'): @@ -3219,7 +3219,7 @@ class TestOvsDvrNeutronAgent(object): 'get_ports_attributes', return_value=[]),\ mock.patch( - 'neutron.agent.common.ovs_lib.OVSBridge.' 'get_vif_ports', + 'neutron.agent.common.ovs_lib.OVSBridge.get_vif_ports', return_value=[]),\ mock.patch('neutron.agent.rpc.PluginReportStateAPI.' 'has_alive_neutron_server'): diff --git a/neutron/tests/unit/scheduler/test_l3_agent_scheduler.py b/neutron/tests/unit/scheduler/test_l3_agent_scheduler.py index b729e0f78b3..046825d3c30 100644 --- a/neutron/tests/unit/scheduler/test_l3_agent_scheduler.py +++ b/neutron/tests/unit/scheduler/test_l3_agent_scheduler.py @@ -1280,9 +1280,8 @@ class L3DvrSchedulerTestCase(L3SchedulerBaseMixin, ] agent_on_host = {'id': 'agent1'} - with mock.patch( - 'neutron.db.db_base_plugin_v2.NeutronDbPluginV2' '.get_ports', - return_value=dvr_ports),\ + with mock.patch.object(db_v2.NeutronDbPluginV2, 'get_ports', + return_value=dvr_ports),\ mock.patch('neutron.api.rpc.agentnotifiers.l3_rpc_agent_api' '.L3AgentNotifyAPI'),\ mock.patch.object( @@ -1318,11 +1317,10 @@ class L3DvrSchedulerTestCase(L3SchedulerBaseMixin, 'distributed': True, } - with mock.patch( - 'neutron.db.db_base_plugin_v2.NeutronDbPluginV2' '.get_port', - return_value=dvr_port),\ - mock.patch('neutron.db.db_base_plugin_v2.NeutronDbPluginV2' - '.get_ports', return_value=[dvr_port]): + with mock.patch.object(db_v2.NeutronDbPluginV2, 'get_port', + return_value=dvr_port),\ + mock.patch.object(db_v2.NeutronDbPluginV2, 'get_ports', + return_value=[dvr_port]): router_id = self.dut.get_dvr_routers_by_subnet_ids( self.adminContext, [subnet_id]) self.assertEqual(r1['id'], router_id.pop()) @@ -1344,9 +1342,8 @@ class L3DvrSchedulerTestCase(L3SchedulerBaseMixin, 'distributed': True, } - with mock.patch( - 'neutron.db.db_base_plugin_v2.NeutronDbPluginV2' '.get_ports', - return_value=[dvr_port]): + with mock.patch.object(db_v2.NeutronDbPluginV2, 'get_ports', + return_value=[dvr_port]): sub_ids = self.dut.get_subnet_ids_on_router(self.adminContext, r1['id']) self.assertEqual(sub_ids.pop(),