Merge "Correct handling mock.patch.stop method"
This commit is contained in:
@@ -339,7 +339,6 @@ class TestBase(base.BaseTestCase):
|
|||||||
self.conf.register_opts(dhcp.OPTS)
|
self.conf.register_opts(dhcp.OPTS)
|
||||||
instance = mock.patch("neutron.agent.linux.dhcp.DeviceManager")
|
instance = mock.patch("neutron.agent.linux.dhcp.DeviceManager")
|
||||||
self.mock_mgr = instance.start()
|
self.mock_mgr = instance.start()
|
||||||
self.addCleanup(self.mock_mgr.stop)
|
|
||||||
self.conf.register_opt(cfg.BoolOpt('enable_isolated_metadata',
|
self.conf.register_opt(cfg.BoolOpt('enable_isolated_metadata',
|
||||||
default=True))
|
default=True))
|
||||||
self.conf(args=args)
|
self.conf(args=args)
|
||||||
@@ -348,10 +347,9 @@ class TestBase(base.BaseTestCase):
|
|||||||
|
|
||||||
self.replace_p = mock.patch('neutron.agent.linux.utils.replace_file')
|
self.replace_p = mock.patch('neutron.agent.linux.utils.replace_file')
|
||||||
self.execute_p = mock.patch('neutron.agent.linux.utils.execute')
|
self.execute_p = mock.patch('neutron.agent.linux.utils.execute')
|
||||||
self.addCleanup(self.replace_p.stop)
|
|
||||||
self.addCleanup(self.execute_p.stop)
|
|
||||||
self.safe = self.replace_p.start()
|
self.safe = self.replace_p.start()
|
||||||
self.execute = self.execute_p.start()
|
self.execute = self.execute_p.start()
|
||||||
|
self.addCleanup(mock.patch.stopall)
|
||||||
|
|
||||||
|
|
||||||
class TestDhcpBase(TestBase):
|
class TestDhcpBase(TestBase):
|
||||||
|
|||||||
Reference in New Issue
Block a user