예제 #1
0
 def test_prompt_passwords_dont_match(self, mock_display_prompt):
     secret = vault.PromptVaultSecret(vault_id='test_id',
                                      prompt_formats=['Vault password: '******'Confirm Vault password: '******'Passwords do not match',
                             secret.load)
예제 #2
0
 def test_prompt_eoferror(self, mock_display_prompt):
     secret = vault.PromptVaultSecret(vault_id='test_id')
     self.assertRaisesRegexp(vault.AnsibleVaultError, 'EOFError.*test_id',
                             secret.load)
예제 #3
0
 def test_custom_prompt(self, mock_display_prompt):
     secret = vault.PromptVaultSecret(
         vault_id='test_id', prompt_formats=['The cow flies at midnight: '])
     secret.load()
     self.assertEqual(secret._bytes, b'the_password')
예제 #4
0
 def test_prompt_formats_none(self, mock_display_prompt):
     secret = vault.PromptVaultSecret(vault_id='test_id')
     secret.load()
     self.assertEqual(secret._bytes, b'the_password')
예제 #5
0
 def test_empty_prompt_formats(self):
     secret = vault.PromptVaultSecret(vault_id='test_id', prompt_formats=[])
     secret.load()
     self.assertIsNone(secret._bytes)
예제 #6
0
 def test_prompt_eoferror(self, mock_display_prompt):
     secret = vault.PromptVaultSecret(vault_id='test_id')
     secret.load()
     self.assertEqual(secret._bytes, None)