Skip to content

Commit

Permalink
updated the unit test inorder to support python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Rama Venkata Loya authored and ramavenkata-loya committed Sep 24, 2024
1 parent aa0c20b commit 74e8d46
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/unit/plugins/lookup/test_conjur_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ def test_merge_dictionaries(self):
{},
{'id': 'host/ansible/ansible-fake', 'api_key': 'fakekey'}
)
self.assertEquals(MockMergeDictionaries.RESPONSE, functionOutput)
self.assertEqual(MockMergeDictionaries.RESPONSE, functionOutput)

def test_load_identity_from_file(self):
load_identity = _load_identity_from_file("/etc/conjur.identity", "https://conjur-fake")
self.assertEquals(MockFileload.RESPONSE, load_identity)
self.assertEqual(MockFileload.RESPONSE, load_identity)

def test_load_conf_from_file(self):
load_conf = _load_conf_from_file("/etc/conjur.conf")
self.assertEquals(MockFileload.RESPONSE, load_conf)
self.assertEqual(MockFileload.RESPONSE, load_conf)

@patch('ansible_collections.cyberark.conjur.plugins.lookup.conjur_variable.open_url')
def test_fetch_conjur_token(self, mock_open_url):
Expand All @@ -49,7 +49,7 @@ def test_fetch_conjur_token(self, mock_open_url):
method="POST",
validate_certs=True,
ca_path="cert_file")
self.assertEquals("response body", result)
self.assertEqual("response body", result)

@patch('ansible_collections.cyberark.conjur.plugins.lookup.conjur_variable._repeat_open_url')
def test_fetch_conjur_variable(self, mock_repeat_open_url):
Expand All @@ -63,7 +63,7 @@ def test_fetch_conjur_variable(self, mock_repeat_open_url):
method="GET",
validate_certs=True,
ca_path="cert_file")
self.assertEquals(['response body'], result)
self.assertEqual(['response body'], result)

@patch('ansible_collections.cyberark.conjur.plugins.lookup.conjur_variable._fetch_conjur_variable')
@patch('ansible_collections.cyberark.conjur.plugins.lookup.conjur_variable._fetch_conjur_token')
Expand All @@ -80,7 +80,7 @@ def test_run(self, mock_merge_dictionaries, mock_fetch_conjur_token, mock_fetch_
kwargs = {'as_file': False, 'conf_file': 'conf_file', 'validate_certs': False}
result = self.lookup.run(terms, **kwargs)

self.assertEquals(result, ["conjur_variable"])
self.assertEqual(result, ["conjur_variable"])

@patch('ansible_collections.cyberark.conjur.plugins.lookup.conjur_variable._fetch_conjur_variable')
@patch('ansible_collections.cyberark.conjur.plugins.lookup.conjur_variable._fetch_conjur_token')
Expand Down

0 comments on commit 74e8d46

Please sign in to comment.