Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
339a02c3
Commit
339a02c3
authored
May 27, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Started reworking module_utils/basic unit tests (v2)
parent
f1ab1c48
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
lib/ansible/module_utils/basic.py
+2
-2
test/units/module_utils/test_basic.py
+0
-0
No files found.
lib/ansible/module_utils/basic.py
View file @
339a02c3
...
@@ -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 '''
...
...
test/units/module_utils/test_basic.py
View file @
339a02c3
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment