testing/mozbase/mozprocess/tests/test_mozprocess_misc.py

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/testing/mozbase/mozprocess/tests/test_mozprocess_misc.py	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,35 @@
     1.4 +#!/usr/bin/env python
     1.5 +
     1.6 +import os
     1.7 +import time
     1.8 +import unittest
     1.9 +import proctest
    1.10 +from mozprocess import processhandler
    1.11 +
    1.12 +here = os.path.dirname(os.path.abspath(__file__))
    1.13 +
    1.14 +class ProcTestMisc(proctest.ProcTest):
    1.15 +    """ Class to test misc operations """
    1.16 +
    1.17 +    def test_process_output_twice(self):
    1.18 +        """
    1.19 +        Process is started, then processOutput is called a second time explicitly
    1.20 +        """
    1.21 +        p = processhandler.ProcessHandler([self.python, self.proclaunch,
    1.22 +                                          "process_waittimeout_10s_python.ini"],
    1.23 +                                          cwd=here)
    1.24 +
    1.25 +        p.run()
    1.26 +        p.processOutput(timeout=5)
    1.27 +        p.wait()
    1.28 +
    1.29 +        detected, output = proctest.check_for_process(self.proclaunch)
    1.30 +        self.determine_status(detected,
    1.31 +                              output,
    1.32 +                              p.proc.returncode,
    1.33 +                              p.didTimeout,
    1.34 +                              False,
    1.35 +                              ())
    1.36 +
    1.37 +if __name__ == '__main__':
    1.38 +    unittest.main()

mercurial