summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChangBo Guo(gcb) <eric.guo@easystack.cn>2014-05-16 17:01:27 +0800
committerChangBo Guo(gcb) <eric.guo@easystack.cn>2014-05-17 11:09:12 +0800
commita37ef609944c80e9acbf9c6052bbaf1cc6032e04 (patch)
treeacca0dd6a60b819d5b7b9eb6ce4b2c4b32c58140
parent4bdf5fc90ee3e84ac675f5f26f7a0d94aacf91c5 (diff)
downloadcliff-a37ef609944c80e9acbf9c6052bbaf1cc6032e04.tar.gz
Fix wrong method name assert_called_once
There isn't method assert_called_once, and it doesn't really check anything. We'd better check mock.called directly. Change-Id: Iffbaa176c3efd41084a655adcbbb0821d8ad496d
-rw-r--r--cliff/tests/test_app.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/cliff/tests/test_app.py b/cliff/tests/test_app.py
index e3bc12e..fc1f4ae 100644
--- a/cliff/tests/test_app.py
+++ b/cliff/tests/test_app.py
@@ -106,7 +106,7 @@ def test_clean_up_error_debug():
else:
assert False, 'Should have had an exception'
- app.clean_up.assert_called_once()
+ assert app.clean_up.called
call_args = app.clean_up.call_args_list[0]
assert call_args == mock.call(mock.ANY, 1, mock.ANY)
args, kwargs = call_args
@@ -123,7 +123,7 @@ def test_error_handling_clean_up_raises_exception():
)
app.run(['error'])
- app.clean_up.assert_called_once()
+ assert app.clean_up.called
call_args = app.clean_up.call_args_list[0]
assert call_args == mock.call(mock.ANY, 1, mock.ANY)
args, kwargs = call_args
@@ -150,7 +150,7 @@ def test_error_handling_clean_up_raises_exception_debug():
else:
assert False, 'Should have had an exception'
- app.clean_up.assert_called_once()
+ assert app.clean_up.called
call_args = app.clean_up.call_args_list[0]
assert call_args == mock.call(mock.ANY, 1, mock.ANY)
args, kwargs = call_args
@@ -167,7 +167,7 @@ def test_normal_clean_up_raises_exception():
)
app.run(['mock'])
- app.clean_up.assert_called_once()
+ assert app.clean_up.called
call_args = app.clean_up.call_args_list[0]
assert call_args == mock.call(mock.ANY, 0, None)
@@ -181,7 +181,7 @@ def test_normal_clean_up_raises_exception_debug():
)
app.run(['--debug', 'mock'])
- app.clean_up.assert_called_once()
+ assert app.clean_up.called
call_args = app.clean_up.call_args_list[0]
assert call_args == mock.call(mock.ANY, 0, None)