def test_updateafterrollback(self):
    app = "testapp"
    key = "root"
    txid = self.zk.get_transaction_id(app)
    self.assertTrue(txid > 0)
    ret = self.zk.acquire_lock(app, txid, key)
    self.assertTrue(ret)
    vid = 0L
    self.zk.register_updated_key(app, txid, vid, key + "/a")
    ret = self.zk.notify_failed_transaction(app, txid)
    self.assertTrue(ret)
    self.assertTrue(self.zk.is_blacklisted(app, txid))

    # update value after rollback
    txid2 = self.zk.get_transaction_id(app)
    self.assertTrue(0 > txid2)
    ret = self.zk.acquire_lock(app, txid2, key)
    self.assertTrue(ret)
    # get previous valid id
    ret = self.zk.get_valid_transaction_id(app, txid, key + "/a")
    self.assertEqual(vid, ret)
    # update previous valid id
    vid = 100L
    self.zk.register_updated_key(app, txid2, vid, key + "/a")
    # try to get updated previous valid id
    ret = self.zk.get_valid_transaction_id(app, txid, key + "/a")
    self.assertEqual(vid, ret)
    self.assertTrue(self.zk.release_lock(app, txid2))
dataset/ETHPy150Open AppScale/appscale/AppDB/test/functional/test_zktransaction.py/TestZKTransaction.test_updateafterrollback/swapped operands of `>`