Commit 7e221943 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

test: patch OpenOffice._startProcess not to put bogus output to stderr.

that prevents detecting the end of unit test.
parent 1c3f3819
...@@ -108,6 +108,27 @@ def stopFakeEnvironment(stop_openoffice=True): ...@@ -108,6 +108,27 @@ def stopFakeEnvironment(stop_openoffice=True):
openoffice.stop() openoffice.stop()
return True return True
if 1:
from cloudooo.handler.ooo.application.openoffice import OpenOffice
from cloudooo.handler.ooo.util import waitStartDaemon, waitStopDaemon
from subprocess import Popen, PIPE
# patch OpenOffice._startProcess not to put bogus output to stderr,
# that prevents detecting the end of unit test.
def _startProcess(self, command, env):
"""Start OpenOffice.org process"""
for i in range(5):
self.stop()
waitStopDaemon(self, self.timeout)
self.process = Popen(command, stderr=PIPE,
close_fds=True,
env=env)
if not waitStartDaemon(self, self.timeout):
continue
if self._testOpenOffice(self.hostname, self.port):
return
OpenOffice._startProcess = _startProcess
class HandlerTestCase(unittest.TestCase): class HandlerTestCase(unittest.TestCase):
"""Test Case to load cloudooo conf.""" """Test Case to load cloudooo conf."""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment