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
c752f012
Commit
c752f012
authored
Oct 11, 2014
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start converting asserts to self.assert*() so we get better error messages
parent
ccd55913
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
test/v2/errors/test_errors.py
+2
-2
test/v2/playbook/test_task.py
+7
-7
No files found.
test/v2/errors/test_errors.py
View file @
c752f012
...
...
@@ -32,7 +32,7 @@ class TestErrors(unittest.TestCase):
def
test_basic_error
(
self
):
e
=
AnsibleError
(
self
.
message
)
assert
e
.
message
==
self
.
message
self
.
assertEqual
(
e
.
message
,
self
.
message
)
def
test_error_with_object
(
self
):
obj
=
AnsibleBaseYAMLObject
()
...
...
@@ -45,4 +45,4 @@ class TestErrors(unittest.TestCase):
with
patch
(
'__builtin__.open'
,
m
):
e
=
AnsibleError
(
self
.
message
,
obj
)
assert
e
.
message
==
'this is the error message
\n
The error occurred on line 1 of the file foo.yml:
\n
this is line 1
\n
^'
self
.
assertEqual
(
e
.
message
,
'this is the error message
\n
The error occurred on line 1 of the file foo.yml:
\n
this is line 1
\n
^'
)
test/v2/playbook/test_task.py
View file @
c752f012
...
...
@@ -50,20 +50,20 @@ class TestTask(unittest.TestCase):
def
test_load_task_simple
(
self
):
t
=
Task
.
load
(
basic_shell_task
)
assert
t
is
not
None
assert
t
.
name
==
basic_shell_task
[
'name'
]
assert
t
.
action
==
'command'
assert
t
.
args
==
dict
(
_raw_params
=
'echo hi'
,
_uses_shell
=
True
)
self
.
assertEqual
(
t
.
name
,
basic_shell_task
[
'name'
])
self
.
assertEqual
(
t
.
action
,
'command'
)
self
.
assertEqual
(
t
.
args
,
dict
(
_raw_params
=
'echo hi'
,
_uses_shell
=
True
)
)
def
test_load_task_kv_form
(
self
):
t
=
Task
.
load
(
kv_shell_task
)
print
"task action is
%
s"
%
t
.
action
assert
t
.
action
==
'command'
assert
t
.
args
==
dict
(
_raw_params
=
'echo hi'
,
_uses_shell
=
True
)
print
(
"task action is
%
s"
%
t
.
action
)
self
.
assertEqual
(
t
.
action
,
'command'
)
self
.
assertEqual
(
t
.
args
,
dict
(
_raw_params
=
'echo hi'
,
_uses_shell
=
True
)
)
def
test_task_auto_name
(
self
):
assert
'name'
not
in
kv_shell_task
t
=
Task
.
load
(
kv_shell_task
)
#
assert t.name == 'shell echo hi'
#
self.assertEqual(t.name, 'shell echo hi')
def
test_task_auto_name_with_role
(
self
):
pass
...
...
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