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
c4b2540e
Commit
c4b2540e
authored
Aug 26, 2015
by
Abhijit Menon-Sen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update tests for VaultEditor API changes
parent
20fd9224
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
test/units/parsing/vault/test_vault_editor.py
+9
-9
No files found.
test/units/parsing/vault/test_vault_editor.py
View file @
c4b2540e
...
...
@@ -81,7 +81,7 @@ class TestVaultEditor(unittest.TestCase):
pass
def
test_methods_exist
(
self
):
v
=
VaultEditor
(
None
,
None
,
None
)
v
=
VaultEditor
(
None
)
slots
=
[
'create_file'
,
'decrypt_file'
,
'edit_file'
,
...
...
@@ -103,8 +103,8 @@ class TestVaultEditor(unittest.TestCase):
tmp_file
=
tempfile
.
NamedTemporaryFile
()
os
.
unlink
(
tmp_file
.
name
)
ve
=
VaultEditor
(
None
,
"ansible"
,
tmp_file
.
name
)
ve
.
create_file
()
ve
=
VaultEditor
(
"ansible"
)
ve
.
create_file
(
tmp_file
.
name
)
self
.
assertTrue
(
os
.
path
.
exists
(
tmp_file
.
name
))
...
...
@@ -120,12 +120,12 @@ class TestVaultEditor(unittest.TestCase):
with
v10_file
as
f
:
f
.
write
(
to_bytes
(
v10_data
))
ve
=
VaultEditor
(
None
,
"ansible"
,
v10_file
.
name
)
ve
=
VaultEditor
(
"ansible"
)
# make sure the password functions for the cipher
error_hit
=
False
try
:
ve
.
decrypt_file
()
ve
.
decrypt_file
(
v10_file
.
name
)
except
errors
.
AnsibleError
as
e
:
error_hit
=
True
...
...
@@ -148,12 +148,12 @@ class TestVaultEditor(unittest.TestCase):
with
v11_file
as
f
:
f
.
write
(
to_bytes
(
v11_data
))
ve
=
VaultEditor
(
None
,
"ansible"
,
v11_file
.
name
)
ve
=
VaultEditor
(
"ansible"
)
# make sure the password functions for the cipher
error_hit
=
False
try
:
ve
.
decrypt_file
()
ve
.
decrypt_file
(
v11_file
.
name
)
except
errors
.
AnsibleError
as
e
:
error_hit
=
True
...
...
@@ -180,12 +180,12 @@ class TestVaultEditor(unittest.TestCase):
with
v10_file
as
f
:
f
.
write
(
to_bytes
(
v10_data
))
ve
=
VaultEditor
(
None
,
"ansible"
,
v10_file
.
name
)
ve
=
VaultEditor
(
"ansible"
)
# make sure the password functions for the cipher
error_hit
=
False
try
:
ve
.
rekey_file
(
'ansible2'
)
ve
.
rekey_file
(
'ansible2'
,
v10_file
.
name
)
except
errors
.
AnsibleError
as
e
:
error_hit
=
True
...
...
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