Skip to content

Commit ceacd1d

Browse files
committed
Fixed argument check
1 parent 521be99 commit ceacd1d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/unit/plugins/modules/test_cert_info.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from unittest.mock import patch
55
from ansible.module_utils import basic
66
from ansible.module_utils.common.text.converters import to_bytes
7+
78
sys.path.append('/home/runner/.ansible/collections/')
89
from ansible_collections.netways.elasticstack.plugins.modules import cert_info
910

@@ -73,7 +74,7 @@ def exit_json(*args, **kwargs):
7374

7475
print(args[0])
7576
# only if passphrase_check mode is disabled
76-
if args['passphrase_check'] is False:
77+
if args[0].params['passphrase_check'] is False:
7778
# check every item in certificate if it matches with the result
7879
# and if that fails, don't catch the Exception, so the test will fail
7980
for item in certificate:
@@ -82,10 +83,10 @@ def exit_json(*args, **kwargs):
8283
# if passphrase_check mode is enabled
8384
else:
8485
# fail checks, if passphrase is wrong and passphrase_check kwarg is not False
85-
if args['passphrase'] == 'PleaseChangeMe-Wrong' and kwargs['passphrase_check'] is not False:
86+
if args[0].params['passphrase'] == 'PleaseChangeMe-Wrong' and kwargs['passphrase_check'] is not False:
8687
checks_passed = False
8788
# fail checks, if passphrase is correct and passphrase_check kwarg is not True
88-
if args['passphrase'] == 'PleaseChangeMe' and kwargs['passphrase_check'] is not True:
89+
if args[0].params['passphrase'] == 'PleaseChangeMe' and kwargs['passphrase_check'] is not True:
8990
checks_passed = False
9091

9192
if checks_passed:

0 commit comments

Comments
 (0)