[Zodb-checkins] SVN: ZODB/trunk/src/ZODB/tests/testMVCCMappingStorage.py More thorough version of the invalidation test
Shane Hathaway
shane at hathawaymix.org
Tue Apr 28 18:21:34 EDT 2009
Log message for revision 99566:
More thorough version of the invalidation test
Changed:
U ZODB/trunk/src/ZODB/tests/testMVCCMappingStorage.py
-=-
Modified: ZODB/trunk/src/ZODB/tests/testMVCCMappingStorage.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/testMVCCMappingStorage.py 2009-04-28 20:13:37 UTC (rev 99565)
+++ ZODB/trunk/src/ZODB/tests/testMVCCMappingStorage.py 2009-04-28 22:21:34 UTC (rev 99566)
@@ -38,23 +38,23 @@
# This will fail if the Connection doesn't poll for changes.
db = DB(self._storage)
try:
- c1 = db.open()
+ c1 = db.open(transaction.TransactionManager())
r1 = c1.root()
r1['myobj'] = 'yes'
- c2 = db.open()
+ c2 = db.open(transaction.TransactionManager())
r2 = c2.root()
self.assert_('myobj' not in r2)
- storage = c1._storage
- t = transaction.Transaction()
- t.description = 'invalidation test'
- storage.tpc_begin(t)
- c1.commit(t)
- storage.tpc_vote(t)
- storage.tpc_finish(t)
+ old_tid = c1._storage._polled_tid
+ c1.transaction_manager.commit()
+ new_tid = c1._storage._polled_tid
+ self.assertNotEqual(new_tid, old_tid)
+ self.assertEqual(c2._storage._polled_tid, old_tid)
+
self.assert_('myobj' not in r2)
c2.sync()
+ self.assertEqual(new_tid, c2._storage._polled_tid)
self.assert_('myobj' in r2)
self.assert_(r2['myobj'] == 'yes')
finally:
More information about the Zodb-checkins
mailing list