summaryrefslogtreecommitdiff
path: root/cliff/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-01-13 16:09:16 +0000
committerGerrit Code Review <review@openstack.org>2016-01-13 16:09:16 +0000
commit7ef0eefa25ad3a263ef56d800fc7aee28d78e1e2 (patch)
treedd92110854cf2f8df3aff4546a6c0f7ed474650b /cliff/tests
parent86ca6130933aefe503eb4954cfd9673bc427450e (diff)
parente2502be43a87eed7735adc9c341d6908a4c73a34 (diff)
downloadcliff-7ef0eefa25ad3a263ef56d800fc7aee28d78e1e2.tar.gz
Merge "Make verbose and quiet mutually exclusive"
Diffstat (limited to 'cliff/tests')
-rw-r--r--cliff/tests/test_app.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/cliff/tests/test_app.py b/cliff/tests/test_app.py
index fefcf6a..19ff46b 100644
--- a/cliff/tests/test_app.py
+++ b/cliff/tests/test_app.py
@@ -523,3 +523,19 @@ def test_fuzzy_no_prefix():
cmd_mgr.add_command('user', utils.TestCommand)
matches = app.get_fuzzy_matches('uesr')
assert matches == ['user']
+
+
+def test_verbose():
+ app, command = make_app()
+ app.clean_up = mock.MagicMock(name='clean_up')
+ app.run(['--verbose', 'mock'])
+ app.clean_up.assert_called_once_with(command.return_value, 0, None)
+ app.clean_up.reset_mock()
+ app.run(['--quiet', 'mock'])
+ app.clean_up.assert_called_once_with(command.return_value, 0, None)
+ try:
+ app.run(['--verbose', '--quiet', 'mock'])
+ except SystemExit:
+ pass
+ else:
+ raise Exception('Exception was not thrown')