summaryrefslogtreecommitdiffstats
path: root/test/units/cli/test_vault.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/units/cli/test_vault.py')
-rw-r--r--test/units/cli/test_vault.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/units/cli/test_vault.py b/test/units/cli/test_vault.py
index 6305a02350..581375ae68 100644
--- a/test/units/cli/test_vault.py
+++ b/test/units/cli/test_vault.py
@@ -120,8 +120,21 @@ class TestVaultCli(unittest.TestCase):
mock_setup_vault_secrets.return_value = [('default', TextVaultSecret('password'))]
cli = VaultCLI(args=['ansible-vault',
'encrypt_string',
- '--prompt',
- 'some string to encrypt'])
+ '--prompt'])
+ cli.parse()
+ cli.run()
+ args, kwargs = mock_display.call_args
+ assert kwargs["private"]
+
+ @patch('ansible.cli.vault.VaultCLI.setup_vault_secrets')
+ @patch('ansible.cli.vault.VaultEditor')
+ @patch('ansible.cli.vault.display.prompt', return_value='a_prompt')
+ def test_shadowed_encrypt_string_prompt_plus(self, mock_display, mock_vault_editor, mock_setup_vault_secrets):
+ mock_setup_vault_secrets.return_value = [('default', TextVaultSecret('password'))]
+ cli = VaultCLI(args=['ansible-vault',
+ 'encrypt_string',
+ 'some string to encrypt',
+ '--prompt'])
cli.parse()
cli.run()
args, kwargs = mock_display.call_args