def test_reset_key(self): rc = RedisCounter(TEST_REDIS) rc.add('some_key', 1, 10) rc.count('some_key') with self.assertRaises(CountLimit): rc.count('some_key') rc.reset('some_key') rc.count('some_key')
def test_reset_key_must_exist_true(self): rc = RedisCounter(TEST_REDIS) with self.assertRaises(KeyNotFound): rc.reset('some_key', must_exist=True)
def test_reset_key_must_exist_false(self): rc = RedisCounter(TEST_REDIS) rc.reset('some_key')