diff options
author | Matt Martz <matt@sivel.net> | 2020-11-18 21:25:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-18 21:25:32 +0100 |
commit | f8ef34672b961a95ec7282643679492862c688ec (patch) | |
tree | d98946bfa62390489cd304aa2ccf092b79e5afa1 /test/units | |
parent | arg_spec - rework _check_arguments() (#72447) (diff) | |
download | ansible-f8ef34672b961a95ec7282643679492862c688ec.tar.xz ansible-f8ef34672b961a95ec7282643679492862c688ec.zip |
Provide better decryption errors for single vault values (#72362)
Fixes #72276
Fixes #72281
Diffstat (limited to 'test/units')
-rw-r--r-- | test/units/config/test_manager.py | 4 | ||||
-rw-r--r-- | test/units/playbook/test_task.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/test/units/config/test_manager.py b/test/units/config/test_manager.py index 15c9c1fb50..a957e39749 100644 --- a/test/units/config/test_manager.py +++ b/test/units/config/test_manager.py @@ -134,7 +134,7 @@ class TestConfigManager: def test_entry_as_vault_var(self): class MockVault: - def decrypt(self, value): + def decrypt(self, value, filename=None, obj=None): return value vault_var = AnsibleVaultEncryptedUnicode(b"vault text") @@ -147,7 +147,7 @@ class TestConfigManager: @pytest.mark.parametrize("value_type", ("str", "string", None)) def test_ensure_type_with_vaulted_str(self, value_type): class MockVault: - def decrypt(self, value): + def decrypt(self, value, filename=None, obj=None): return value vault_var = AnsibleVaultEncryptedUnicode(b"vault text") diff --git a/test/units/playbook/test_task.py b/test/units/playbook/test_task.py index f94419a22f..cc05388516 100644 --- a/test/units/playbook/test_task.py +++ b/test/units/playbook/test_task.py @@ -82,8 +82,8 @@ class TestTask(unittest.TestCase): Task.load(ds) self.assertIsInstance(cm.exception, errors.AnsibleParserError) - self.assertEqual(cm.exception._obj, ds) - self.assertEqual(cm.exception._obj, kv_bad_args_ds) + self.assertEqual(cm.exception.obj, ds) + self.assertEqual(cm.exception.obj, kv_bad_args_ds) self.assertIn("The error appears to be in 'test_task_faux_playbook.yml", cm.exception.message) self.assertIn(kv_bad_args_str, cm.exception.message) self.assertIn('apk', cm.exception.message) |