mirror of
https://github.com/ansible/ansible.git
synced 2026-08-03 00:22:10 +02:00
Use assertRaisesRegex in unit test (#80663)
This commit is contained in:
@@ -171,9 +171,9 @@ class TestVaultCli(unittest.TestCase):
|
||||
mock_setup_vault_secrets.return_value = [('default', TextVaultSecret('password'))]
|
||||
cli = VaultCLI(args=['ansible-vault', 'create', '/dev/null/foo'])
|
||||
cli.parse()
|
||||
self.assertRaisesRegexp(errors.AnsibleOptionsError,
|
||||
"not a tty, editor cannot be opened",
|
||||
cli.run)
|
||||
self.assertRaisesRegex(errors.AnsibleOptionsError,
|
||||
"not a tty, editor cannot be opened",
|
||||
cli.run)
|
||||
|
||||
@patch('ansible.cli.vault.VaultCLI.setup_vault_secrets')
|
||||
@patch('ansible.cli.vault.VaultEditor')
|
||||
|
||||
Reference in New Issue
Block a user