diff options
author | Michael Davies <michael@the-davies.net> | 2014-09-05 08:56:40 +0930 |
---|---|---|
committer | Michael Davies <michael@the-davies.net> | 2014-09-05 15:19:35 +0930 |
commit | 3ec92068f0e31e20be2c10249aa837c382a037ff (patch) | |
tree | 6b561b5c6b021856b0400fbfc2b57cb683cbf7f0 | |
parent | 42675b2d7ad93f4bba9c4216874c68b8e5834147 (diff) | |
download | cliff-3ec92068f0e31e20be2c10249aa837c382a037ff.tar.gz |
mock.assert_called_once() is not a valid method
mock.assert_called_once() is a no-op that tests nothing. Instead
with mock.assert_called_once_with() should be used (or use
assertEqual(1, mock_obj.call_count) if you don't want to check
parameters).
Change-Id: Ib302f2e888306558535cdd3e5edf447809aee430
Partial-Bug: #1365751
-rw-r--r-- | cliff/tests/test_app.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cliff/tests/test_app.py b/cliff/tests/test_app.py index fc1f4ae..efff788 100644 --- a/cliff/tests/test_app.py +++ b/cliff/tests/test_app.py @@ -87,7 +87,7 @@ def test_clean_up_error(): app.clean_up = mock.MagicMock(name='clean_up') app.run(['error']) - app.clean_up.assert_called_once() + app.clean_up.assert_called_once_with(mock.ANY, mock.ANY, mock.ANY) call_args = app.clean_up.call_args_list[0] assert call_args == mock.call(mock.ANY, 1, mock.ANY) args, kwargs = call_args |