mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 10:51:24 -07:00
Started reworking module_utils/basic unit tests (v2)
This commit is contained in:
parent
f1ab1c48f4
commit
339a02c384
2 changed files with 199 additions and 259 deletions
|
@ -930,7 +930,7 @@ class AnsibleModule(object):
|
|||
for check in spec:
|
||||
count = self._count_terms(check)
|
||||
if count > 1:
|
||||
self.fail_json(msg="parameters are mutually exclusive: %s" % check)
|
||||
self.fail_json(msg="parameters are mutually exclusive: %s" % (check,))
|
||||
|
||||
def _check_required_one_of(self, spec):
|
||||
if spec is None:
|
||||
|
@ -948,7 +948,7 @@ class AnsibleModule(object):
|
|||
non_zero = [ c for c in counts if c > 0 ]
|
||||
if len(non_zero) > 0:
|
||||
if 0 in counts:
|
||||
self.fail_json(msg="parameters are required together: %s" % check)
|
||||
self.fail_json(msg="parameters are required together: %s" % (check,))
|
||||
|
||||
def _check_required_arguments(self):
|
||||
''' ensure all required arguments are present '''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue