From 5526a3fbafb9bb3a73b9c482792c6fa652f22035 Mon Sep 17 00:00:00 2001 From: zhangyangyang Date: Mon, 11 Sep 2017 21:32:51 +0800 Subject: [PATCH] change assert(Not)Equals to assert(Not)Equal According to http://docs.python.org/2/library/unittest.html assert(Not)Equals is a deprecated alias of assert(Not)Equal. Change-Id: Ibda52e45efbf1266c272835e6a961e9eaf428e85 Closes-Bug: #1329757 --- unit_tests/test_hacluster_utils.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/unit_tests/test_hacluster_utils.py b/unit_tests/test_hacluster_utils.py index 4cbfb79..e367e24 100644 --- a/unit_tests/test_hacluster_utils.py +++ b/unit_tests/test_hacluster_utils.py @@ -104,8 +104,8 @@ class UtilsTestCase(unittest.TestCase): self.assertRaises(ValueError, utils.get_transport) def test_nulls(self): - self.assertEquals(utils.nulls({'a': '', 'b': None, 'c': False}), - ['a', 'b']) + self.assertEqual(utils.nulls({'a': '', 'b': None, 'c': False}), + ['a', 'b']) @mock.patch.object(utils, 'local_unit', lambda *args: 'hanode/0') @mock.patch.object(utils, 'get_ipv6_addr') @@ -227,7 +227,7 @@ class UtilsTestCase(unittest.TestCase): def test_try_pcmk_wait(self, mock_wait_for_pcmk): # Returns OK mock_wait_for_pcmk.side_effect = None - self.assertEquals(None, utils.try_pcmk_wait()) + self.assertEqual(None, utils.try_pcmk_wait()) # Raises Exception mock_wait_for_pcmk.side_effect = pcmk.ServicesNotUp @@ -329,7 +329,7 @@ class UtilsTestCase(unittest.TestCase): mock_is_unit_paused_set.return_value = True mock_path_exists.return_value = True utils.emit_systemd_overrides_file() - self.assertEquals(2, len(mock_write_file.mock_calls)) + self.assertEqual(2, len(mock_write_file.mock_calls)) mock_render_template.assert_has_calls( [mock.call('systemd-overrides.conf', cfg), mock.call('systemd-overrides.conf', cfg)]) @@ -348,7 +348,7 @@ class UtilsTestCase(unittest.TestCase): mock_is_unit_paused_set.return_value = True mock_path_exists.return_value = True utils.emit_systemd_overrides_file() - self.assertEquals(2, len(mock_write_file.mock_calls)) + self.assertEqual(2, len(mock_write_file.mock_calls)) mock_render_template.assert_has_calls( [mock.call('systemd-overrides.conf', expected_cfg), mock.call('systemd-overrides.conf', expected_cfg)])