diff options
Diffstat (limited to 'Lib/bsddb/test/test_distributed_transactions.py')
-rw-r--r-- | Lib/bsddb/test/test_distributed_transactions.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Lib/bsddb/test/test_distributed_transactions.py b/Lib/bsddb/test/test_distributed_transactions.py index f864b88336..1711fc5966 100644 --- a/Lib/bsddb/test/test_distributed_transactions.py +++ b/Lib/bsddb/test/test_distributed_transactions.py @@ -35,9 +35,9 @@ class DBTxn_distributed(unittest.TestCase): db.DB_INIT_TXN | db.DB_INIT_LOG | db.DB_INIT_MPOOL | db.DB_INIT_LOCK, 0666) self.db = db.DB(self.dbenv) - self.db.set_re_len(db.DB_XIDDATASIZE) + self.db.set_re_len(db.DB_GID_SIZE) if must_open_db : - if db.version() > (4,1) : + if db.version() >= (4,2) : txn=self.dbenv.txn_begin() self.db.open(self.filename, db.DB_QUEUE, db.DB_CREATE | db.DB_THREAD, 0666, @@ -76,7 +76,7 @@ class DBTxn_distributed(unittest.TestCase): # let them be garbage collected. for i in xrange(self.num_txns) : txn = self.dbenv.txn_begin() - gid = "%%%dd" %db.DB_XIDDATASIZE + gid = "%%%dd" %db.DB_GID_SIZE gid = adapt(gid %i) self.db.put(i, gid, txn=txn, flags=db.DB_APPEND) txns.add(gid) @@ -88,9 +88,9 @@ class DBTxn_distributed(unittest.TestCase): # Get "to be recovered" transactions but # let them be garbage collected. recovered_txns=self.dbenv.txn_recover() - self.assertEquals(self.num_txns,len(recovered_txns)) + self.assertEqual(self.num_txns,len(recovered_txns)) for gid,txn in recovered_txns : - self.assert_(gid in txns) + self.assertTrue(gid in txns) del txn del recovered_txns @@ -99,7 +99,7 @@ class DBTxn_distributed(unittest.TestCase): # Get "to be recovered" transactions. Commit, abort and # discard them. recovered_txns=self.dbenv.txn_recover() - self.assertEquals(self.num_txns,len(recovered_txns)) + self.assertEqual(self.num_txns,len(recovered_txns)) discard_txns=set() committed_txns=set() state=0 @@ -122,7 +122,7 @@ class DBTxn_distributed(unittest.TestCase): # Verify the discarded transactions are still # around, and dispose them. recovered_txns=self.dbenv.txn_recover() - self.assertEquals(len(discard_txns),len(recovered_txns)) + self.assertEqual(len(discard_txns),len(recovered_txns)) for gid,txn in recovered_txns : txn.abort() del txn @@ -133,8 +133,8 @@ class DBTxn_distributed(unittest.TestCase): # Be sure there are not pending transactions. # Check also database size. recovered_txns=self.dbenv.txn_recover() - self.assert_(len(recovered_txns)==0) - self.assertEquals(len(committed_txns),self.db.stat()["nkeys"]) + self.assertTrue(len(recovered_txns)==0) + self.assertEqual(len(committed_txns),self.db.stat()["nkeys"]) class DBTxn_distributedSYNC(DBTxn_distributed): nosync=False |