From: Kevin Benton Date: Fri, 26 Jun 2015 05:08:41 +0000 (-0700) Subject: Remove duplicated mock patch of ip_lib X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=78700ba70620f7b53b5ae71332cca853f5afa467;p=openstack-build%2Fneutron-build.git Remove duplicated mock patch of ip_lib The functional tests for agents were patching ip_lib in the function to configure an agent, so any tests that relied on multiple agents would patch ip_lib multiple times. Partial-Bug: #1468998 Change-Id: Ibccf586dea870ec222369c0876f17f8eaf9a1aca --- diff --git a/neutron/tests/functional/agent/test_l3_agent.py b/neutron/tests/functional/agent/test_l3_agent.py index 8631e9d27..74d2e486f 100644 --- a/neutron/tests/functional/agent/test_l3_agent.py +++ b/neutron/tests/functional/agent/test_l3_agent.py @@ -68,6 +68,7 @@ class L3AgentTestFramework(base.BaseSudoTestCase): self.mock_plugin_api = mock.patch( 'neutron.agent.l3.agent.L3PluginApi').start().return_value mock.patch('neutron.agent.rpc.PluginReportStateAPI').start() + mock.patch.object(ip_lib, '_arping').start() self.agent = self._configure_agent('agent1') def _get_config_opts(self): @@ -104,7 +105,6 @@ class L3AgentTestFramework(base.BaseSudoTestCase): get_temp_file_path('external/pids')) conf.set_override('host', host) agent = neutron_l3_agent.L3NATAgentWithStateReport(host, conf) - mock.patch.object(ip_lib, '_arping').start() return agent