'Test if pid is None/non-None before/after process termination.  This
reuses process_echoer.py to get a process that blocks on stdin.'

def test_unsetPid(self):

    finished = defer.Deferred()
    p = TrivialProcessProtocol(finished)
    scriptPath = 'twisted.test.process_echoer'
    procTrans = reactor.spawnProcess(p, pyExe, [pyExe, '-u', '-m', scriptPath], env=properEnv)
    self.assertTrue(procTrans.pid)
    def afterProcessEnd(ignored):
        self.assertIsNone(procTrans.pid)
    p.transport.closeStdin()
    return finished.addCallback(afterProcessEnd)
