From 8744b5b1a501fafe05f32ce1a2bcadda5d0025f6 Mon Sep 17 00:00:00 2001 From: zhangyangyang Date: Wed, 13 Sep 2017 17:22:48 +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: Ibadf2b2c6cb09db6f5cc191240aad2ac8cb4ea33 Closes-Bug: #1329757 --- tests/cmd/subcommands/test_update.py | 2 +- tests/cmd/test_config.py | 6 +++--- tests/jenkins_manager/test_manager.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/cmd/subcommands/test_update.py b/tests/cmd/subcommands/test_update.py index 86d502cb3..77dbc1d21 100644 --- a/tests/cmd/subcommands/test_update.py +++ b/tests/cmd/subcommands/test_update.py @@ -114,7 +114,7 @@ class UpdateTests(CmdTestsBase): jenkins_delete_job.assert_has_calls(calls) # to ensure only the calls we expected were made, have to check # there were no others, as no API call for assert_has_only_calls - self.assertEquals(jenkins_delete_job.call_count, len(calls)) + self.assertEqual(jenkins_delete_job.call_count, len(calls)) def test_update_timeout_not_set(self): """Validate update timeout behavior when timeout not explicitly configured. diff --git a/tests/cmd/test_config.py b/tests/cmd/test_config.py index de8257f4a..fd6397d6f 100644 --- a/tests/cmd/test_config.py +++ b/tests/cmd/test_config.py @@ -130,8 +130,8 @@ class TestConfigs(CmdTestsBase): # contains the expected timeout value. jjb_config = jenkins_mock.call_args[0][0] - self.assertEquals(jjb_config.jenkins['timeout'], - builder._DEFAULT_TIMEOUT) + self.assertEqual(jjb_config.jenkins['timeout'], + builder._DEFAULT_TIMEOUT) @mock.patch('jenkins_jobs.cli.subcommand.update.JenkinsManager') def test_update_timeout_set(self, jenkins_mock): @@ -154,4 +154,4 @@ class TestConfigs(CmdTestsBase): # contains the expected timeout value. jjb_config = jenkins_mock.call_args[0][0] - self.assertEquals(jjb_config.jenkins['timeout'], 0.2) + self.assertEqual(jjb_config.jenkins['timeout'], 0.2) diff --git a/tests/jenkins_manager/test_manager.py b/tests/jenkins_manager/test_manager.py index 6a8edb25b..a1738329a 100644 --- a/tests/jenkins_manager/test_manager.py +++ b/tests/jenkins_manager/test_manager.py @@ -67,7 +67,7 @@ class TestCaseTestJenkinsManager(base.BaseTestCase): patches['is_managed'].side_effect = [True, True] self.builder.delete_old_managed() - self.assertEquals(patches['delete_job'].call_count, 2) + self.assertEqual(patches['delete_job'].call_count, 2) def _get_plugins_info_error_test(self, error_string): builder = jenkins_jobs.builder.JenkinsManager(self.jjb_config)