diff options
author | ChangBo Guo(gcb) <eric.guo@easystack.cn> | 2015-12-30 15:07:38 +0800 |
---|---|---|
committer | ChangBo Guo(gcb) <eric.guo@easystack.cn> | 2015-12-30 15:07:38 +0800 |
commit | 6e05db4eaa0da4903170d396c539f133eef75804 (patch) | |
tree | 283751378c296ef98170bbd52945e98cc9ffc124 /cliff/tests | |
parent | 85c0fd4f2ab920f9914bd0e285cb13591b60ccd3 (diff) | |
download | cliff-6e05db4eaa0da4903170d396c539f133eef75804.tar.gz |
Don't use non-existent method of Mock
Mock object only has method assert_called_once_with(), doesn't
have called_once_with(), so use right method to confirm test.
Change-Id: Icc96178a8255f10bf3a8584e5f70dc9446894347
Diffstat (limited to 'cliff/tests')
-rw-r--r-- | cliff/tests/test_commandmanager.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cliff/tests/test_commandmanager.py b/cliff/tests/test_commandmanager.py index b995b7d..f131712 100644 --- a/cliff/tests/test_commandmanager.py +++ b/cliff/tests/test_commandmanager.py @@ -77,7 +77,7 @@ def test_load_commands(): with mock.patch('pkg_resources.iter_entry_points', mock_pkg_resources) as iter_entry_points: mgr = CommandManager('test') - assert iter_entry_points.called_once_with('test') + iter_entry_points.assert_called_once_with('test') names = [n for n, v in mgr] assert names == ['test'] @@ -89,7 +89,7 @@ def test_load_commands_keep_underscores(): with mock.patch('pkg_resources.iter_entry_points', mock_pkg_resources) as iter_entry_points: mgr = CommandManager('test', convert_underscores=False) - assert iter_entry_points.called_once_with('test') + iter_entry_points.assert_called_once_with('test') names = [n for n, v in mgr] assert names == ['test_cmd'] @@ -101,6 +101,6 @@ def test_load_commands_replace_underscores(): with mock.patch('pkg_resources.iter_entry_points', mock_pkg_resources) as iter_entry_points: mgr = CommandManager('test', convert_underscores=True) - assert iter_entry_points.called_once_with('test') + iter_entry_points.assert_called_once_with('test') names = [n for n, v in mgr] assert names == ['test cmd'] |