Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ai
cam
Commits
e0d9a42e
Commit
e0d9a42e
authored
Apr 09, 2015
by
godog
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix tests
parent
92f665c0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
cam/tests/test_openssl_wrap.py
cam/tests/test_openssl_wrap.py
+5
-5
No files found.
cam/tests/test_openssl_wrap.py
View file @
e0d9a42e
...
...
@@ -11,7 +11,7 @@ class PopenStub(object):
self
.
stdout
=
stdout
self
.
returncode
=
returncode
def
communicate
(
self
):
def
communicate
(
self
,
stdin
=
None
):
return
self
.
stdout
,
'unused'
...
...
@@ -27,7 +27,7 @@ class OpensslWrapTest(unittest.TestCase):
def
test_run
(
self
):
self
.
mox
.
StubOutWithMock
(
subprocess
,
'Popen'
,
use_mock_anything
=
True
)
pipe_stub
=
PopenStub
(
stdout
=
'output'
)
subprocess
.
Popen
([
'openssl'
,
'test'
],
stdout
=
subprocess
.
PIPE
,
env
=
mox
.
IsA
(
dict
)
subprocess
.
Popen
([
'
/usr/bin/
openssl'
,
'test'
],
stdout
=
subprocess
.
PIPE
,
env
=
mox
.
IsA
(
dict
)
).
AndReturn
(
pipe_stub
)
self
.
mox
.
ReplayAll
()
result
=
openssl_wrap
.
run
(
'test'
)
...
...
@@ -36,7 +36,7 @@ class OpensslWrapTest(unittest.TestCase):
def
test_run_fails
(
self
):
self
.
mox
.
StubOutWithMock
(
subprocess
,
'Popen'
,
use_mock_anything
=
True
)
pipe_stub
=
PopenStub
(
returncode
=
1
)
subprocess
.
Popen
([
'openssl'
,
'test'
],
stdout
=
subprocess
.
PIPE
,
env
=
mox
.
IsA
(
dict
)
subprocess
.
Popen
([
'
/usr/bin/
openssl'
,
'test'
],
stdout
=
subprocess
.
PIPE
,
env
=
mox
.
IsA
(
dict
)
).
AndReturn
(
pipe_stub
)
self
.
mox
.
ReplayAll
()
def
r
():
...
...
@@ -46,10 +46,10 @@ class OpensslWrapTest(unittest.TestCase):
def
test_run_with_config
(
self
):
self
.
mox
.
StubOutWithMock
(
subprocess
,
'Popen'
,
use_mock_anything
=
True
)
pipe_stub
=
PopenStub
(
stdout
=
'output'
)
subprocess
.
Popen
([
'openssl'
,
'test'
,
'-config'
,
'conf'
,
'-batch'
,
'arg'
],
subprocess
.
Popen
([
'
/usr/bin/
openssl'
,
'test'
,
'-config'
,
'conf'
,
'-batch'
,
'arg'
],
stdout
=
subprocess
.
PIPE
,
env
=
mox
.
IsA
(
dict
)).
AndReturn
(
pipe_stub
)
self
.
mox
.
ReplayAll
()
result
=
openssl_wrap
.
run_with_config
(
'.'
,
'conf'
,
'test'
,
'arg'
)
result
=
openssl_wrap
.
run_with_config
(
'.'
,
'conf'
,
None
,
'test'
,
'arg'
)
if
__name__
==
'__main__'
:
...
...
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