[Neo-report] r2107 vincent - in /trunk/neo: storage/ tests/storage/
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu May 13 21:14:32 CEST 2010
Author: vincent
Date: Thu May 13 21:14:32 2010
New Revision: 2107
Log:
Add a public method on storage TransactionManager to get write lock tid.
Modified:
trunk/neo/storage/transactions.py
trunk/neo/tests/storage/testTransactions.py
Modified: trunk/neo/storage/transactions.py
==============================================================================
--- trunk/neo/storage/transactions.py [iso-8859-1] (original)
+++ trunk/neo/storage/transactions.py [iso-8859-1] Thu May 13 21:14:32 2010
@@ -196,6 +196,9 @@
"""
transaction = self._getTransaction(tid, uuid)
transaction.prepare(oid_list, user, desc, ext, packed)
+
+ def getLockingTID(self, oid):
+ return self._store_lock_dict.get(oid)
def storeObject(self, uuid, tid, serial, oid, compression, checksum, data,
value_serial):
Modified: trunk/neo/tests/storage/testTransactions.py
==============================================================================
--- trunk/neo/tests/storage/testTransactions.py [iso-8859-1] (original)
+++ trunk/neo/tests/storage/testTransactions.py [iso-8859-1] Thu May 13 21:14:32 2010
@@ -300,5 +300,14 @@
self.assertEqual(self.manager.getObjectFromTransaction(tid1, obj1[0]),
obj1)
+ def test_getLockingTID(self):
+ uuid = self.getNewUUID()
+ serial1, obj1 = self._getObject(1)
+ oid1 = obj1[0]
+ tid1, txn1 = self._getTransaction()
+ self.assertEqual(self.manager.getLockingTID(oid1), None)
+ self.manager.storeObject(uuid, tid1, serial1, *obj1)
+ self.assertEqual(self.manager.getLockingTID(oid1), tid1)
+
if __name__ == "__main__":
unittest.main()
More information about the Neo-report
mailing list