Use assertRaisesRegex in unit test (#80663)

pull/80668/head
Matt Clay 2 years ago committed by GitHub
parent 058b722a54
commit 71f6e10dae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -171,9 +171,9 @@ class TestVaultCli(unittest.TestCase):
mock_setup_vault_secrets.return_value = [('default', TextVaultSecret('password'))] mock_setup_vault_secrets.return_value = [('default', TextVaultSecret('password'))]
cli = VaultCLI(args=['ansible-vault', 'create', '/dev/null/foo']) cli = VaultCLI(args=['ansible-vault', 'create', '/dev/null/foo'])
cli.parse() cli.parse()
self.assertRaisesRegexp(errors.AnsibleOptionsError, self.assertRaisesRegex(errors.AnsibleOptionsError,
"not a tty, editor cannot be opened", "not a tty, editor cannot be opened",
cli.run) cli.run)
@patch('ansible.cli.vault.VaultCLI.setup_vault_secrets') @patch('ansible.cli.vault.VaultCLI.setup_vault_secrets')
@patch('ansible.cli.vault.VaultEditor') @patch('ansible.cli.vault.VaultEditor')

Loading…
Cancel
Save