'A spawning a subprocess which echoes its stdin to its stdout via
L{IReactorProcess.spawnProcess} will result in that echoed output being
delivered to outReceived.'

def test_echo(self):

    finished = defer.Deferred()
    p = EchoProtocol(finished)
    scriptPath = 'twisted.test.process_echoer'
    reactor.spawnProcess(p, pyExe, [pyExe, '-u', '-m', scriptPath], env=properEnv)
    def asserts(ignored):
        self.assertFalse(p.failure, p.failure)
        self.assertTrue(hasattr(p, 'buffer'))
        self.assertEqual(len(p.buffer), len((p.s * p.n)))
    def takedownProcess(err):
        p.transport.closeStdin()
        return err
    return finished.addCallback(asserts).addErrback(takedownProcess)
