X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2Ftests%2Funit%2Fbenchmark%2Fcore%2Ftest_report.py;h=524302f923aa7fc9d3e01488b2200f963c163ccb;hb=60e326463ae06038facf79f14e29901e9596e0dc;hp=3d9a503b6ad1a82164e57a1b71d570b4ae0570fc;hpb=4946bfbee16b9738a996d7ec6750caa9c064d156;p=yardstick.git diff --git a/yardstick/tests/unit/benchmark/core/test_report.py b/yardstick/tests/unit/benchmark/core/test_report.py index 3d9a503b6..524302f92 100644 --- a/yardstick/tests/unit/benchmark/core/test_report.py +++ b/yardstick/tests/unit/benchmark/core/test_report.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################## # Copyright (c) 2017 Rajesh Kudaka. # @@ -44,16 +42,16 @@ class ReportTestCase(unittest.TestCase): self.param.task_id = [FAKE_TASK_ID] self.rep = report.Report() - @mock.patch('yardstick.benchmark.core.report.Report._get_tasks') - @mock.patch('yardstick.benchmark.core.report.Report._get_fieldkeys') - @mock.patch('yardstick.benchmark.core.report.Report._validate') + @mock.patch.object(report.Report, '_get_tasks') + @mock.patch.object(report.Report, '_get_fieldkeys') + @mock.patch.object(report.Report, '_validate') def test_generate_success(self, mock_valid, mock_keys, mock_tasks): mock_tasks.return_value = FAKE_DB_TASK mock_keys.return_value = FAKE_DB_FIELDKEYS self.rep.generate(self.param) mock_valid.assert_called_once_with(FAKE_YAML_NAME, FAKE_TASK_ID) - self.assertEqual(1, mock_tasks.call_count) - self.assertEqual(1, mock_keys.call_count) + mock_tasks.assert_called_once_with() + mock_keys.assert_called_once_with() # pylint: disable=deprecated-method def test_invalid_yaml_name(self):