From 55d59992c6695e2ba4093b1d76905f3263dfba3e Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Mon, 12 Mar 2018 15:07:59 +0000 Subject: assert[Greater,Equal] -> assert_{,not_}called assertEqual(mock_xxx.call_count, 1) -> mock_xxx.assert_called_once assertEqual(mock_xxx.call_count, 0) -> mock_xxx.assert_not_called assertGreater(mock.call_count, 0) -> mock.assert_called() assertGreaterEqual(mock.call_count, 1) -> mock.assert_called() JIRA: YARDSTICK-1069 Change-Id: I890084d120c8e78304e169e2a0e5d30011a41525 Signed-off-by: Emma Foley --- yardstick/tests/unit/benchmark/runner/test_search.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'yardstick/tests/unit/benchmark/runner') diff --git a/yardstick/tests/unit/benchmark/runner/test_search.py b/yardstick/tests/unit/benchmark/runner/test_search.py index 4e5b4fe77..00a241c7c 100644 --- a/yardstick/tests/unit/benchmark/runner/test_search.py +++ b/yardstick/tests/unit/benchmark/runner/test_search.py @@ -38,7 +38,7 @@ class TestSearchRunnerHelper(unittest.TestCase): with helper.get_benchmark_instance(): helper() - self.assertEqual(method.call_count, 1) + method.assert_called_once() def test___call___error(self): cls = mock.MagicMock() @@ -199,4 +199,4 @@ class TestSearchRunner(unittest.TestCase): runner = SearchRunner({}) runner._run_benchmark(cls, 'my_method', scenario_cfg, {}) - self.assertEqual(mock_multi_process.Process.call_count, 1) + mock_multi_process.Process.assert_called_once() -- cgit 1.2.3-korg