Skip to content

Commit

Permalink
added the unit test case for extra-vars
Browse files Browse the repository at this point in the history
  • Loading branch information
ramavenkata-loya committed May 22, 2024
1 parent a109a12 commit a1d4fff
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/unit/plugins/lookup/test_conjur_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,10 @@ def test_run_no_variable_path(self):
with self.assertRaises(AnsibleError) as context:
self.lookup.run([''], **kwargs)
self.assertEqual(context.exception.message, "Invalid secret path: empty secret path not accepted.")

def test_extra_vars(self):
variables = {'conjur_account': 'fakeaccount', 'conjur_appliance_url': 'https://conjur-fake', 'conjur_cert_file': './conjurfake.pem', 'conjur_authn_login': 'host/ansible/ansible-fake', 'conjur_authn_api_key': 'fakekey'}
terms = ['ansible/fake-secret']
kwargs = {'validate_certs': True}
output = self.lookup.run(terms, variables, **kwargs)
self.assertEqual(output, "conjur_variable")

0 comments on commit a1d4fff

Please sign in to comment.