def _cancelConnectTimeoutTest(self, connect):
        reactor = MemoryReactorClock()
        cc = ClientCreator(reactor, Protocol)
        d = connect(reactor, cc)
        connector = reactor.connectors.pop()
        # Sanity check - there is an outstanding delayed call to fire the
        # Deferred.
        self.assertEqual(len(reactor.getDelayedCalls()), 1)

        # Cancel the Deferred, disconnecting the transport just set up and
        # cancelling the delayed call.
        d.cancel()

        self.assertEqual(reactor.getDelayedCalls(), [])

        # A real connector implementation is responsible for disconnecting the
        # transport as well.  For our purposes, just check that someone told the
        # connector to disconnect.
        self.assertTrue(connector._disconnected)

        return self.assertFailure(d, CancelledError)
Function called when the login thread has been executed.
dataset/ETHPy150Open twisted/twisted/twisted/internet/test/test_protocol.py/ClientCreatorTests._cancelConnectTimeoutTest--crossover with--dataset/ETHPy150Open Morgawr/gogonlinux/gog_utils/gog_gui.py/GogTuxGUI.login_callback