'Verify that a protocol connected to L{StandardIO} can disconnect
itself using C{transport.loseConnection}.'

def test_loseConnection(self):

    errorLogFile = self.mktemp()
    log.msg(('Child    process    logging    to    ' + errorLogFile))
    p = StandardIOTestProcessProtocol()
    d = p.onCompletion
    self._spawnProcess(p, 'stdio_test_loseconn', errorLogFile)
    def processEnded(reason):
        with open(errorLogFile, 'r') as f:
            for line in f:
                log.msg(('Child    logged:    ' + line.rstrip()))
        self.failIfIn(1, p.data)
        reason.trap(error.ProcessDone)
    return self._requireFailure(d, processEnded)
