From e9d0fc3cd5cdbfcf58620aa0638e7b0ca3ade720 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Wed, 15 Oct 2014 21:28:39 +0000 Subject: [PATCH] Actually test interactive password prompt * keystoneclient/tests/v2_0/test_shell.py (ShellTests.test_user_create_password_prompt): Remove the password from the calling environment and fake out the check for an interactive terminal session so that the code which implements password prompting will actually be exercised. Change-Id: I46f45553995316c7d006a83897413d57e127e48c --- keystoneclient/tests/v2_0/test_shell.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keystoneclient/tests/v2_0/test_shell.py b/keystoneclient/tests/v2_0/test_shell.py index 0fafb7167..57bbe9d01 100644 --- a/keystoneclient/tests/v2_0/test_shell.py +++ b/keystoneclient/tests/v2_0/test_shell.py @@ -104,6 +104,8 @@ class ShellTests(utils.TestCase): self.stub_url('POST', ['users'], json={'user': {}}) with mock.patch('getpass.getpass') as mock_getpass: + del(os.environ['OS_PASSWORD']) + mock_stdin.isatty = lambda: True mock_getpass.return_value = 'newpass' self.run_command('user-create --name new-user --pass')