michael@0: #!/usr/bin/env python michael@0: michael@0: import os michael@0: import time michael@0: import unittest michael@0: import proctest michael@0: from mozprocess import processhandler michael@0: michael@0: here = os.path.dirname(os.path.abspath(__file__)) michael@0: michael@0: class ProcTestMisc(proctest.ProcTest): michael@0: """ Class to test misc operations """ michael@0: michael@0: def test_process_output_twice(self): michael@0: """ michael@0: Process is started, then processOutput is called a second time explicitly michael@0: """ michael@0: p = processhandler.ProcessHandler([self.python, self.proclaunch, michael@0: "process_waittimeout_10s_python.ini"], michael@0: cwd=here) michael@0: michael@0: p.run() michael@0: p.processOutput(timeout=5) michael@0: p.wait() michael@0: michael@0: detected, output = proctest.check_for_process(self.proclaunch) michael@0: self.determine_status(detected, michael@0: output, michael@0: p.proc.returncode, michael@0: p.didTimeout, michael@0: False, michael@0: ()) michael@0: michael@0: if __name__ == '__main__': michael@0: unittest.main()