'The transport connected to the protocol has a C{loseConnection} method
which causes the channel in which the command is running to close and
the overall connection to be closed.'

def test_loseConnection(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)
    self.loseConnectionToServer(server, client, protocol, pump)
    self.assertTrue(client.transport.disconnecting)
