'L{process.Process.signalProcess} raises L{error.ProcessExitedAlready}
if the process has exited but that twisted hasn\'t seen it (for example,
if the process has been waited outside of twisted): C{os.kill} then
raise C{OSError} with C{errno.ESRCH} as errno.'

def test_killExitedButNotDetected(self):

    self.mockos.child = False
    self.mockos.waitChild = (0, 0)
    cmd = '/mock/ouch'
    p = TrivialProcessProtocol(None)
    proc = reactor.spawnProcess(p, cmd, ['ouch'], env=None, usePTY=False)
    self.mockos.raiseKill = OSError(errno.ESRCH, 'Not    found')
    self.assertRaises(error.ProcessExitedAlready, proc.signalProcess, 'KILL')
