Python twisted.internet.interfaces.IReactorProcess() Examples
The following are 4
code examples of twisted.internet.interfaces.IReactorProcess().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
twisted.internet.interfaces
, or try the search function
.
Example #1
Source File: test_process.py From Safejumper-for-Desktop with GNU General Public License v2.0 | 6 votes |
def test_echo(self): """ 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. """ finished = defer.Deferred() p = EchoProtocol(finished) scriptPath = b"twisted.test.process_echoer" reactor.spawnProcess(p, pyExe, [pyExe, b'-u', b"-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)
Example #2
Source File: test_process.py From learn_python3_spider with MIT License | 6 votes |
def test_echo(self): """ 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. """ finished = defer.Deferred() p = EchoProtocol(finished) scriptPath = b"twisted.test.process_echoer" reactor.spawnProcess(p, pyExe, [pyExe, b'-u', b"-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)
Example #3
Source File: test_disttrial.py From learn_python3_spider with MIT License | 5 votes |
def spawnProcess(self, worker, *args, **kwargs): """ See L{IReactorProcess.spawnProcess}. @param worker: See L{IReactorProcess.spawnProcess}. @param args: See L{IReactorProcess.spawnProcess}. @param kwargs: See L{IReactorProcess.spawnProcess}. """ self._workers.append(worker) worker.makeConnection(FakeTransport()) self.spawnCount += 1
Example #4
Source File: test_disttrial.py From learn_python3_spider with MIT License | 5 votes |
def test_providesIReactorProcess(self): """ L{CountingReactor} instances provide L{IReactorProcess}. """ verify.verifyObject(interfaces.IReactorProcess, self.reactor)