'If the process ends with a failure, the returned deferred fires with
the reason.'

def test_process_failure(self):

    reactor = ProcessCoreReactor()
    d = run(reactor, ['command', 'and', 'args'])
    [process] = reactor.processes
    expected_failure = Failure(ProcessTerminated(1))
    process.processProtocol.processEnded(expected_failure)
    self.assertEqual(self.failureResultOf(d), expected_failure)
