summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Stanley <fungi@yuggoth.org>2014-10-15 21:28:39 +0000
committerJeremy Stanley <fungi@yuggoth.org>2014-10-15 21:42:20 +0000
commite9d0fc3cd5cdbfcf58620aa0638e7b0ca3ade720 (patch)
tree70866994c1f3bc781aef175312660267141532ef
parent8b267842a701970d4e1aae2f115afe4d73bc5ee6 (diff)
downloadpython-keystoneclient-e9d0fc3cd5cdbfcf58620aa0638e7b0ca3ade720.tar.gz
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
-rw-r--r--keystoneclient/tests/v2_0/test_shell.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/keystoneclient/tests/v2_0/test_shell.py b/keystoneclient/tests/v2_0/test_shell.py
index 0fafb71..57bbe9d 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')