'When the command closes the channel, the protocol\'s C{connectionLost}
method is called.'

def test_connectionLost(self):

    self.realm.channelLookup['session'] = WorkingExecSession
    endpoint = self.create()
    factory = Factory()
    factory.protocol = Protocol
    connected = endpoint.connect(factory)
    (server, client, pump) = self.finishConnection()
    protocol = self.successResultOf(connected)
    connectionLost = []
    protocol.connectionLost = connectionLost.append
    channelId = protocol.transport.id
    server.service.channels[channelId].loseConnection()
    pump.pump()
    connectionLost[0].trap(ConnectionDone)
    self.assertClientTransportState(client, False)
