def _cancelConnectTest(self, connect):
        reactor = MemoryReactorClock()
        cc = ClientCreator(reactor, Protocol)
        d = connect(cc)
        connector = reactor.connectors.pop()
        self.assertFalse(connector._disconnected)
        d.cancel()
        self.assertTrue(connector._disconnected)
        return self.assertFailure(d, CancelledError)
Helper for implementing a test to verify that cancellation of the
dataset/ETHPy150Open twisted/twisted/twisted/internet/test/test_protocol.py/ClientCreatorTests._cancelConnectTest