From 4546d70b7532291150e9a5237f93dbe090bf99ff Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Tue, 19 Dec 2017 15:15:37 +0000 Subject: Replace assertEqual(x, True|False) with assert[True|False](x) Change-Id: Id19df79b4d27aab1a83d8350ce6395e87c13472b JIRA: YARDSTICK-903 Signed-off-by: Emma Foley --- tests/unit/benchmark/scenarios/availability/test_monitor_command.py | 4 ++-- tests/unit/benchmark/scenarios/availability/test_serviceha.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/unit/benchmark/scenarios/availability') diff --git a/tests/unit/benchmark/scenarios/availability/test_monitor_command.py b/tests/unit/benchmark/scenarios/availability/test_monitor_command.py index abef1e8bb..b84cef23c 100644 --- a/tests/unit/benchmark/scenarios/availability/test_monitor_command.py +++ b/tests/unit/benchmark/scenarios/availability/test_monitor_command.py @@ -61,7 +61,7 @@ class MonitorOpenstackCmdTestCase(unittest.TestCase): instance.setup() mock_subprocess_check_output.return_value = (0, 'unittest') ret = instance.monitor_func() - self.assertEqual(ret, True) + self.assertTrue(ret) instance._result = {"outage_time": 0} instance.verify_SLA() @@ -72,7 +72,7 @@ class MonitorOpenstackCmdTestCase(unittest.TestCase): instance.setup() mock_subprocess_check_output.side_effect = RuntimeError ret = instance.monitor_func() - self.assertEqual(ret, False) + self.assertFalse(ret) mock_log.error.assert_called_once() instance._result = {"outage_time": 10} instance.verify_SLA() diff --git a/tests/unit/benchmark/scenarios/availability/test_serviceha.py b/tests/unit/benchmark/scenarios/availability/test_serviceha.py index 2b630da5a..97d534894 100644 --- a/tests/unit/benchmark/scenarios/availability/test_serviceha.py +++ b/tests/unit/benchmark/scenarios/availability/test_serviceha.py @@ -56,14 +56,14 @@ class ServicehaTestCase(unittest.TestCase): p = serviceha.ServiceHA(self.args, self.ctx) p.setup() - self.assertEqual(p.setup_done, True) + self.assertTrue(p.setup_done) mock_monitor.MonitorMgr().verify_SLA.return_value = True ret = {} p.run(ret) p.teardown() p.setup() - self.assertEqual(p.setup_done, True) + self.assertTrue(p.setup_done) # def test__serviceha_run_sla_error(self, mock_attacker, mock_monitor): # p = serviceha.ServiceHA(self.args, self.ctx) -- cgit 1.2.3-korg