|
1 #!/usr/bin/env python |
|
2 |
|
3 import os |
|
4 import time |
|
5 import unittest |
|
6 import proctest |
|
7 from mozprocess import processhandler |
|
8 |
|
9 here = os.path.dirname(os.path.abspath(__file__)) |
|
10 |
|
11 class ProcTestMisc(proctest.ProcTest): |
|
12 """ Class to test misc operations """ |
|
13 |
|
14 def test_process_output_twice(self): |
|
15 """ |
|
16 Process is started, then processOutput is called a second time explicitly |
|
17 """ |
|
18 p = processhandler.ProcessHandler([self.python, self.proclaunch, |
|
19 "process_waittimeout_10s_python.ini"], |
|
20 cwd=here) |
|
21 |
|
22 p.run() |
|
23 p.processOutput(timeout=5) |
|
24 p.wait() |
|
25 |
|
26 detected, output = proctest.check_for_process(self.proclaunch) |
|
27 self.determine_status(detected, |
|
28 output, |
|
29 p.proc.returncode, |
|
30 p.didTimeout, |
|
31 False, |
|
32 ()) |
|
33 |
|
34 if __name__ == '__main__': |
|
35 unittest.main() |