summaryrefslogtreecommitdiff
path: root/tests/test_shell.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_shell.py')
-rw-r--r--tests/test_shell.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_shell.py b/tests/test_shell.py
index ac634c32..d259785f 100644
--- a/tests/test_shell.py
+++ b/tests/test_shell.py
@@ -108,6 +108,30 @@ class TestShell(utils.TestCase):
default_args["image_api_version"])
+class TestShellHelp(TestShell):
+ """Test the deferred help flag"""
+ def setUp(self):
+ super(TestShellHelp, self).setUp()
+ self.orig_env, os.environ = os.environ, {}
+
+ def tearDown(self):
+ super(TestShellHelp, self).tearDown()
+ os.environ = self.orig_env
+
+ def test_help_options(self):
+ flag = "-h list server"
+ kwargs = {
+ "deferred_help": True,
+ }
+ with mock.patch("openstackclient.shell.OpenStackShell.initialize_app",
+ self.app):
+ _shell, _cmd = make_shell(), flag
+ fake_execute(_shell, _cmd)
+
+ self.assertEqual(_shell.options.deferred_help,
+ kwargs["deferred_help"])
+
+
class TestShellPasswordAuth(TestShell):
def setUp(self):
super(TestShellPasswordAuth, self).setUp()