def test_run_process_with_timeout_timeout(self):
     # On process timeout, the errback is fired with `TimeoutError`
     # failure.
     clock = task.Clock()
     d = run_process_with_timeout(('sleep', '2'), timeout=1, clock=clock)
     clock.advance(2)
     return assert_fails_with(d, error.TimeoutError)
 def test_run_process_with_timeout_timeout(self):
     # On process timeout, the errback is fired with `TimeoutError`
     # failure.
     clock = task.Clock()
     d = run_process_with_timeout(
         ('sleep', '2'), timeout=1, clock=clock)
     clock.advance(2)
     return assert_fails_with(d, error.TimeoutError)
 def test_run_proces_with_timeout_success(self):
     # On success, i.e process succeeded before the specified timeout,
     # callback is fired with 'None'.
     d = run_process_with_timeout(('true',))
     def check_success_result(result):
         self.assertEquals(result, None, "Success result is not None.")
     d.addCallback(check_success_result)
     return d
    def test_run_proces_with_timeout_success(self):
        # On success, i.e process succeeded before the specified timeout,
        # callback is fired with 'None'.
        d = run_process_with_timeout(('true', ))

        def check_success_result(result):
            self.assertEquals(result, None, "Success result is not None.")

        d.addCallback(check_success_result)
        return d
 def test_run_process_with_timeout_broken(self):
     # On broken process, the errback is fired with a `ProcessTerminated`
     # failure.
     d = run_process_with_timeout(('does-not-exist', ))
     return assert_fails_with(d, error.ProcessTerminated)
 def test_run_process_with_timeout_failure(self):
     # On failed process, the errback is fired with a `ProcessTerminated`
     # failure.
     d = run_process_with_timeout(('false', ))
     return assert_fails_with(d, error.ProcessTerminated)
 def test_run_process_with_timeout_broken(self):
     # On broken process, the errback is fired with a `ProcessTerminated`
     # failure.
     d = run_process_with_timeout(('does-not-exist',))
     return assert_fails_with(d, error.ProcessTerminated)
 def test_run_process_with_timeout_failure(self):
     # On failed process, the errback is fired with a `ProcessTerminated`
     # failure.
     d = run_process_with_timeout(('false',))
     return assert_fails_with(d, error.ProcessTerminated)