'L{_NewConnectionHelper.cleanupConnection} closes the transport with
C{abortConnection} if called with C{immediate} set to C{True}.'

def test_cleanupConnectionImmediately(self):

    class Abortable:
        aborted = False
        def abortConnection(self):
            '\n                                                                Abort    the    connection.\n                                                                '
            self.aborted = True
    helper = _NewConnectionHelper(None, None, None, None, None, None, None, None, None, None)
    connection = SSHConnection()
    connection.transport = SSHClientTransport()
    connection.transport.transport = Abortable()
    helper.cleanupConnection(connection, True)
    self.assertTrue(connection.transport.transport.aborted)
