summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Davies <michael@the-davies.net>2014-09-05 08:56:40 +0930
committerMichael Davies <michael@the-davies.net>2014-09-05 15:19:35 +0930
commit3ec92068f0e31e20be2c10249aa837c382a037ff (patch)
tree6b561b5c6b021856b0400fbfc2b57cb683cbf7f0
parent42675b2d7ad93f4bba9c4216874c68b8e5834147 (diff)
downloadcliff-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.py2
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