def test_decr(self): key = uuid.uuid4().hex value = 2 delta = 2 client = Client(['127.0.0.1:11211']) yield client.set(key, value, 5) res = yield client.decr(key, delta=delta) self.assertEqual(res, value - delta)
def test_decr_not_exist(self): key = uuid.uuid4().hex client = Client(['127.0.0.1:11211']) res = yield client.decr(key, delta=2) self.assertEqual(res, None)