diff options
author | Emma Foley <emma.l.foley@intel.com> | 2018-03-05 17:41:33 +0000 |
---|---|---|
committer | Emma Foley <emma.l.foley@intel.com> | 2018-03-05 17:41:33 +0000 |
commit | 3478059d4397c5ee3a1d1e4707c5883afd0974a8 (patch) | |
tree | 2c2d5c68c3f2a6232ab0b71e00e07184ded9926f /yardstick/tests/unit/benchmark/scenarios/lib/test_check_numa_info.py | |
parent | 8400c1895c49cb0c7802692f75d820fb5b8b7dc4 (diff) |
assertTrue(mock.called) -> mock.assert_called
When checking whether a mocked method has been called,
mock.assert_called or mock.assert_called_once should be
used, and not unittest.assertTrue(mock.called)
This change does this update.
It can be verified with:
grep -irn "self.assertTrue(.*called)" --exclude-dir=.tox
And the replacement was done with:
sed -i 's/self.assertTrue(\(.*\).called)/\1.assert_called_once()/g' <list_of_files>
Change-Id: I4f26e0c736bf33e0b2413c8e8c33dbdb91f090e2
JIRA: YARDSTICK-865
Signed-off-by: Emma Foley <emma.l.foley@intel.com>
Diffstat (limited to 'yardstick/tests/unit/benchmark/scenarios/lib/test_check_numa_info.py')
-rw-r--r-- | yardstick/tests/unit/benchmark/scenarios/lib/test_check_numa_info.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/yardstick/tests/unit/benchmark/scenarios/lib/test_check_numa_info.py b/yardstick/tests/unit/benchmark/scenarios/lib/test_check_numa_info.py index a50e752fa..270c9d3c9 100644 --- a/yardstick/tests/unit/benchmark/scenarios/lib/test_check_numa_info.py +++ b/yardstick/tests/unit/benchmark/scenarios/lib/test_check_numa_info.py @@ -19,7 +19,7 @@ class CheckNumaInfoTestCase(unittest.TestCase): scenario_cfg = {'info1': {}, 'info2': {}} obj = CheckNumaInfo(scenario_cfg, {}) obj.run({}) - self.assertTrue(mock_check_vm2.called) + mock_check_vm2.assert_called_once() def test_check_vm2_status_length_eq_1(self): info1 = { |