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')
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():
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__':