Commit 339a02c3 by James Cammarata

Started reworking module_utils/basic unit tests (v2)

parent f1ab1c48
...@@ -930,7 +930,7 @@ class AnsibleModule(object): ...@@ -930,7 +930,7 @@ class AnsibleModule(object):
for check in spec: for check in spec:
count = self._count_terms(check) count = self._count_terms(check)
if count > 1: 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): def _check_required_one_of(self, spec):
if spec is None: if spec is None:
...@@ -948,7 +948,7 @@ class AnsibleModule(object): ...@@ -948,7 +948,7 @@ class AnsibleModule(object):
non_zero = [ c for c in counts if c > 0 ] non_zero = [ c for c in counts if c > 0 ]
if len(non_zero) > 0: if len(non_zero) > 0:
if 0 in counts: 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): def _check_required_arguments(self):
''' ensure all required arguments are present ''' ''' ensure all required arguments are present '''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment