]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
fixes test_kill_pids_in_file conflicts
authorSean McCully <sean_mccully@yahoo.com>
Thu, 26 Sep 2013 03:56:34 +0000 (22:56 -0500)
committerSean McCully <sean_mccully@yahoo.com>
Thu, 24 Oct 2013 02:08:59 +0000 (21:08 -0500)
Fixes Bug: #1231246
Change-Id: Ibedd59d6570cd8d5020e99125c6808d5d2170851

neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_namespace_driver.py

index 3e39b0bd22738308ebf800c3a96822e16a1c4f74..78a45f5fcc8729c9dd01b8c7238b7cdf56ee7405 100644 (file)
@@ -284,8 +284,9 @@ class TestHaproxyNSDriver(base.BaseTestCase):
         with contextlib.nested(
             mock.patch('os.path.exists'),
             mock.patch('__builtin__.open'),
-            mock.patch('neutron.agent.linux.utils.execute')
-        ) as (path_exists, mock_open, mock_execute):
+            mock.patch('neutron.agent.linux.utils.execute'),
+            mock.patch.object(namespace_driver.LOG, 'exception'),
+        ) as (path_exists, mock_open, mock_execute, mock_log):
             file_mock = mock.MagicMock()
             mock_open.return_value = file_mock
             file_mock.__enter__.return_value = file_mock
@@ -300,6 +301,7 @@ class TestHaproxyNSDriver(base.BaseTestCase):
             path_exists.return_value = True
             mock_execute.side_effect = RuntimeError
             namespace_driver.kill_pids_in_file('sudo', 'test_path')
+            self.assertTrue(mock_log.called)
             mock_execute.assert_called_once_with(
                 ['kill', '-9', '123'], 'sudo')