switch the digest default to SHA2
[stack/cam.git] / cam / tests / test_openssl_wrap.py
index 6392e1b..8ac2dad 100644 (file)
@@ -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
+        subprocess.Popen(['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
+        subprocess.Popen(['openssl', 'test'], stdout=subprocess.PIPE, env=mox.IsA(dict)
                          ).AndReturn(pipe_stub)
         self.mox.ReplayAll()
         def r():
@@ -47,9 +47,9 @@ class OpensslWrapTest(unittest.TestCase):
         self.mox.StubOutWithMock(subprocess, 'Popen', use_mock_anything=True)
         pipe_stub = PopenStub(stdout='output')
         subprocess.Popen(['openssl', 'test', '-config', 'conf', '-batch', 'arg'],
-                         stdout=subprocess.PIPE).AndReturn(pipe_stub)
+                         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', 'test', 'arg')
 
 
 if __name__ == '__main__':