'Verify that timer cancellation is honored'

def test_timer_cancellation(self, *args):

    connection = twistedreactor.TwistedConnection('1.2.3.4', cql_version='3.0.1')
    timeout = 0.1
    callback = TimerCallback(timeout)
    timer = connection.create_timer(timeout, callback.invoke)
    timer.cancel()
    time.sleep(0.2)
    timer_manager = connection._loop._timers
    self.assertFalse(timer_manager._queue)
    self.assertFalse(timer_manager._new_timers)
    self.assertFalse(callback.was_invoked())
