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
This commit is contained in:
@@ -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')
|
||||
|
||||
|
Reference in New Issue
Block a user