From e0d9a42e95d549c7e82fd846b2840009fdc92800 Mon Sep 17 00:00:00 2001 From: godog Date: Thu, 9 Apr 2015 01:00:50 +0100 Subject: [PATCH] fix tests --- cam/tests/test_openssl_wrap.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cam/tests/test_openssl_wrap.py b/cam/tests/test_openssl_wrap.py index 5aee14a..a6bb053 100644 --- a/cam/tests/test_openssl_wrap.py +++ b/cam/tests/test_openssl_wrap.py @@ -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__': -- GitLab