diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2010-11-21 13:34:58 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2010-11-21 13:34:58 (GMT) |
commit | 2623a37852153363335956afab010cb0beb7e74e (patch) | |
tree | e443a19bb7a87adc2158ef2e32da5c2f3b21936c /Lib/bsddb | |
parent | 40a92f5c65767d80ebc3b3be2c2ccfc5db3afb7b (diff) | |
download | cpython-2623a37852153363335956afab010cb0beb7e74e.zip cpython-2623a37852153363335956afab010cb0beb7e74e.tar.gz cpython-2623a37852153363335956afab010cb0beb7e74e.tar.bz2 |
Merged revisions 86596 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line
#9424: Replace deprecated assert* methods in the Python test suite.
........
Diffstat (limited to 'Lib/bsddb')
-rw-r--r-- | Lib/bsddb/test/test_associate.py | 8 | ||||
-rw-r--r-- | Lib/bsddb/test/test_basics.py | 12 | ||||
-rw-r--r-- | Lib/bsddb/test/test_compat.py | 2 | ||||
-rw-r--r-- | Lib/bsddb/test/test_cursor_pget_bug.py | 10 | ||||
-rw-r--r-- | Lib/bsddb/test/test_dbshelve.py | 2 | ||||
-rw-r--r-- | Lib/bsddb/test/test_dbtables.py | 4 | ||||
-rw-r--r-- | Lib/bsddb/test/test_distributed_transactions.py | 12 | ||||
-rw-r--r-- | Lib/bsddb/test/test_early_close.py | 2 | ||||
-rw-r--r-- | Lib/bsddb/test/test_fileid.py | 4 | ||||
-rw-r--r-- | Lib/bsddb/test/test_get_none.py | 2 | ||||
-rw-r--r-- | Lib/bsddb/test/test_join.py | 2 | ||||
-rw-r--r-- | Lib/bsddb/test/test_misc.py | 6 | ||||
-rw-r--r-- | Lib/bsddb/test/test_recno.py | 2 | ||||
-rw-r--r-- | Lib/bsddb/test/test_replication.py | 48 | ||||
-rw-r--r-- | Lib/bsddb/test/test_sequence.py | 60 |
15 files changed, 88 insertions, 88 deletions
diff --git a/Lib/bsddb/test/test_associate.py b/Lib/bsddb/test/test_associate.py index 6f240a0..7a49e11 100644 --- a/Lib/bsddb/test/test_associate.py +++ b/Lib/bsddb/test/test_associate.py @@ -233,7 +233,7 @@ class AssociateTestCase(unittest.TestCase): self.assertEqual(vals, None, vals) vals = secDB.pget('Unknown', txn=txn) - self.assert_(vals[0] == 99 or vals[0] == '99', vals) + self.assertTrue(vals[0] == 99 or vals[0] == '99', vals) vals[1].index('Unknown') vals[1].index('Unnamed') vals[1].index('unknown') @@ -245,9 +245,9 @@ class AssociateTestCase(unittest.TestCase): rec = self.cur.first() while rec is not None: if type(self.keytype) == type(''): - self.assert_(int(rec[0])) # for primary db, key is a number + self.assertTrue(int(rec[0])) # for primary db, key is a number else: - self.assert_(rec[0] and type(rec[0]) == type(0)) + self.assertTrue(rec[0] and type(rec[0]) == type(0)) count = count + 1 if verbose: print rec @@ -262,7 +262,7 @@ class AssociateTestCase(unittest.TestCase): # test cursor pget vals = self.cur.pget('Unknown', flags=db.DB_LAST) - self.assert_(vals[1] == 99 or vals[1] == '99', vals) + self.assertTrue(vals[1] == 99 or vals[1] == '99', vals) self.assertEqual(vals[0], 'Unknown') vals[2].index('Unknown') vals[2].index('Unnamed') diff --git a/Lib/bsddb/test/test_basics.py b/Lib/bsddb/test/test_basics.py index 8b05c61..4d43390 100644 --- a/Lib/bsddb/test/test_basics.py +++ b/Lib/bsddb/test/test_basics.py @@ -612,7 +612,7 @@ class BasicTestCase(unittest.TestCase): d.put("abcde", "ABCDE"); num = d.truncate() - self.assert_(num >= 1, "truncate returned <= 0 on non-empty database") + self.assertTrue(num >= 1, "truncate returned <= 0 on non-empty database") num = d.truncate() self.assertEqual(num, 0, "truncate on empty DB returned nonzero (%r)" % (num,)) @@ -631,9 +631,9 @@ class BasicTestCase(unittest.TestCase): if db.version() >= (4, 6): def test08_exists(self) : self.d.put("abcde", "ABCDE") - self.assert_(self.d.exists("abcde") == True, + self.assertTrue(self.d.exists("abcde") == True, "DB->exists() returns wrong value") - self.assert_(self.d.exists("x") == False, + self.assertTrue(self.d.exists("x") == False, "DB->exists() returns wrong value") #---------------------------------------- @@ -806,9 +806,9 @@ class BasicTransactionTestCase(BasicTestCase): self.d.put("abcde", "ABCDE", txn=txn) txn.commit() txn = self.env.txn_begin() - self.assert_(self.d.exists("abcde", txn=txn) == True, + self.assertTrue(self.d.exists("abcde", txn=txn) == True, "DB->exists() returns wrong value") - self.assert_(self.d.exists("x", txn=txn) == False, + self.assertTrue(self.d.exists("x", txn=txn) == False, "DB->exists() returns wrong value") txn.abort() @@ -823,7 +823,7 @@ class BasicTransactionTestCase(BasicTestCase): d.put("abcde", "ABCDE"); txn = self.env.txn_begin() num = d.truncate(txn) - self.assert_(num >= 1, "truncate returned <= 0 on non-empty database") + self.assertTrue(num >= 1, "truncate returned <= 0 on non-empty database") num = d.truncate(txn) self.assertEqual(num, 0, "truncate on empty DB returned nonzero (%r)" % (num,)) diff --git a/Lib/bsddb/test/test_compat.py b/Lib/bsddb/test/test_compat.py index 0b0fa70..7679f19 100644 --- a/Lib/bsddb/test/test_compat.py +++ b/Lib/bsddb/test/test_compat.py @@ -119,7 +119,7 @@ class CompatibilityTestCase(unittest.TestCase): if verbose: print rec - self.assert_(f.has_key('f'), 'Error, missing key!') + self.assertTrue(f.has_key('f'), 'Error, missing key!') # test that set_location() returns the next nearest key, value # on btree databases and raises KeyError on others. diff --git a/Lib/bsddb/test/test_cursor_pget_bug.py b/Lib/bsddb/test/test_cursor_pget_bug.py index 68b6a87..22d3dc1 100644 --- a/Lib/bsddb/test/test_cursor_pget_bug.py +++ b/Lib/bsddb/test/test_cursor_pget_bug.py @@ -37,12 +37,12 @@ class pget_bugTestCase(unittest.TestCase): def test_pget(self): cursor = self.secondary_db.cursor() - self.assertEquals(('eggs', 'salad', 'eggs'), cursor.pget(key='eggs', flags=db.DB_SET)) - self.assertEquals(('eggs', 'omelet', 'eggs'), cursor.pget(db.DB_NEXT_DUP)) - self.assertEquals(None, cursor.pget(db.DB_NEXT_DUP)) + self.assertEqual(('eggs', 'salad', 'eggs'), cursor.pget(key='eggs', flags=db.DB_SET)) + self.assertEqual(('eggs', 'omelet', 'eggs'), cursor.pget(db.DB_NEXT_DUP)) + self.assertEqual(None, cursor.pget(db.DB_NEXT_DUP)) - self.assertEquals(('ham', 'spam', 'ham'), cursor.pget('ham', 'spam', flags=db.DB_SET)) - self.assertEquals(None, cursor.pget(db.DB_NEXT_DUP)) + self.assertEqual(('ham', 'spam', 'ham'), cursor.pget('ham', 'spam', flags=db.DB_SET)) + self.assertEqual(None, cursor.pget(db.DB_NEXT_DUP)) cursor.close() diff --git a/Lib/bsddb/test/test_dbshelve.py b/Lib/bsddb/test/test_dbshelve.py index 7ad1fd1..c0135fe 100644 --- a/Lib/bsddb/test/test_dbshelve.py +++ b/Lib/bsddb/test/test_dbshelve.py @@ -255,7 +255,7 @@ class DBShelveTestCase(unittest.TestCase): self.assertEqual(value.L, [x] * 10) else: - self.assert_(0, 'Unknown key type, fix the test') + self.assertTrue(0, 'Unknown key type, fix the test') #---------------------------------------------------------------------- diff --git a/Lib/bsddb/test/test_dbtables.py b/Lib/bsddb/test/test_dbtables.py index c6ecc13..bb31381 100644 --- a/Lib/bsddb/test/test_dbtables.py +++ b/Lib/bsddb/test/test_dbtables.py @@ -84,8 +84,8 @@ class TableDBTestCase(unittest.TestCase): colval = pickle.loads(values[0][colname]) else : colval = pickle.loads(bytes(values[0][colname], "iso8859-1")) - self.assert_(colval > 3.141) - self.assert_(colval < 3.142) + self.assertTrue(colval > 3.141) + self.assertTrue(colval < 3.142) def test02(self): diff --git a/Lib/bsddb/test/test_distributed_transactions.py b/Lib/bsddb/test/test_distributed_transactions.py index a36bd66..1711fc5 100644 --- a/Lib/bsddb/test/test_distributed_transactions.py +++ b/Lib/bsddb/test/test_distributed_transactions.py @@ -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 diff --git a/Lib/bsddb/test/test_early_close.py b/Lib/bsddb/test/test_early_close.py index e0c1e1d..86b86dc 100644 --- a/Lib/bsddb/test/test_early_close.py +++ b/Lib/bsddb/test/test_early_close.py @@ -162,7 +162,7 @@ class DBEnvClosedEarlyCrash(unittest.TestCase): txn = dbenv.txn_begin() c1 = d.cursor(txn) c2 = c1.dup() - self.assertEquals(("XXX", "yyy"), c1.first()) + self.assertEqual(("XXX", "yyy"), c1.first()) # Not interested in warnings about implicit close. import warnings diff --git a/Lib/bsddb/test/test_fileid.py b/Lib/bsddb/test/test_fileid.py index 2df2382..095ec83 100644 --- a/Lib/bsddb/test/test_fileid.py +++ b/Lib/bsddb/test/test_fileid.py @@ -35,11 +35,11 @@ class FileidResetTestCase(unittest.TestCase): self.db1 = db.DB(self.db_env) self.db1.open(self.db_path_1, dbtype=db.DB_HASH, flags=db.DB_RDONLY) - self.assertEquals(self.db1.get('spam'), 'eggs') + self.assertEqual(self.db1.get('spam'), 'eggs') self.db2 = db.DB(self.db_env) self.db2.open(self.db_path_2, dbtype=db.DB_HASH, flags=db.DB_RDONLY) - self.assertEquals(self.db2.get('spam'), 'spam') + self.assertEqual(self.db2.get('spam'), 'spam') self.db1.close() self.db2.close() diff --git a/Lib/bsddb/test/test_get_none.py b/Lib/bsddb/test/test_get_none.py index 4aaf2fd..8763b54 100644 --- a/Lib/bsddb/test/test_get_none.py +++ b/Lib/bsddb/test/test_get_none.py @@ -76,7 +76,7 @@ class GetReturnsNoneTestCase(unittest.TestCase): break self.assertNotEqual(rec, None) - self.assert_(exceptionHappened) + self.assertTrue(exceptionHappened) self.assertEqual(count, len(string.letters)) c.close() diff --git a/Lib/bsddb/test/test_join.py b/Lib/bsddb/test/test_join.py index 9b45df8..1f0dfff 100644 --- a/Lib/bsddb/test/test_join.py +++ b/Lib/bsddb/test/test_join.py @@ -67,7 +67,7 @@ class JoinTestCase(unittest.TestCase): # Don't do the .set() in an assert, or you can get a bogus failure # when running python -O tmp = sCursor.set('red') - self.assert_(tmp) + self.assertTrue(tmp) # FIXME: jCursor doesn't properly hold a reference to its # cursors, if they are closed before jcursor is used it diff --git a/Lib/bsddb/test/test_misc.py b/Lib/bsddb/test/test_misc.py index 7b111a8..8dda296 100644 --- a/Lib/bsddb/test/test_misc.py +++ b/Lib/bsddb/test/test_misc.py @@ -32,7 +32,7 @@ class MiscTestCase(unittest.TestCase): def test02_db_home(self): env = db.DBEnv() # check for crash fixed when db_home is used before open() - self.assert_(env.db_home is None) + self.assertTrue(env.db_home is None) env.open(self.homeDir, db.DB_CREATE) if sys.version_info[0] < 3 : self.assertEqual(self.homeDir, env.db_home) @@ -43,7 +43,7 @@ class MiscTestCase(unittest.TestCase): db = hashopen(self.filename) db.close() rp = repr(db) - self.assertEquals(rp, "{}") + self.assertEqual(rp, "{}") def test04_repr_db(self) : db = hashopen(self.filename) @@ -54,7 +54,7 @@ class MiscTestCase(unittest.TestCase): db.close() db = hashopen(self.filename) rp = repr(db) - self.assertEquals(rp, repr(d)) + self.assertEqual(rp, repr(d)) db.close() # http://sourceforge.net/tracker/index.php?func=detail&aid=1708868&group_id=13900&atid=313900 diff --git a/Lib/bsddb/test/test_recno.py b/Lib/bsddb/test/test_recno.py index f86a28b..3191fdc 100644 --- a/Lib/bsddb/test/test_recno.py +++ b/Lib/bsddb/test/test_recno.py @@ -18,7 +18,7 @@ class SimpleRecnoTestCase(unittest.TestCase): def assertFalse(self, expr, msg=None) : return self.failIf(expr,msg=msg) def assertTrue(self, expr, msg=None) : - return self.assert_(expr, msg=msg) + return self.assertTrue(expr, msg=msg) if (sys.version_info < (2, 7)) or ((sys.version_info >= (3, 0)) and (sys.version_info < (3, 2))) : diff --git a/Lib/bsddb/test/test_replication.py b/Lib/bsddb/test/test_replication.py index 9ed2126..f3e974f 100644 --- a/Lib/bsddb/test/test_replication.py +++ b/Lib/bsddb/test/test_replication.py @@ -88,23 +88,23 @@ class DBReplicationManager(DBReplication) : self.dbenvMaster.rep_set_timeout(db.DB_REP_CONNECTION_RETRY,100123) self.dbenvClient.rep_set_timeout(db.DB_REP_CONNECTION_RETRY,100321) - self.assertEquals(self.dbenvMaster.rep_get_timeout( + self.assertEqual(self.dbenvMaster.rep_get_timeout( db.DB_REP_CONNECTION_RETRY), 100123) - self.assertEquals(self.dbenvClient.rep_get_timeout( + self.assertEqual(self.dbenvClient.rep_get_timeout( db.DB_REP_CONNECTION_RETRY), 100321) self.dbenvMaster.rep_set_timeout(db.DB_REP_ELECTION_TIMEOUT, 100234) self.dbenvClient.rep_set_timeout(db.DB_REP_ELECTION_TIMEOUT, 100432) - self.assertEquals(self.dbenvMaster.rep_get_timeout( + self.assertEqual(self.dbenvMaster.rep_get_timeout( db.DB_REP_ELECTION_TIMEOUT), 100234) - self.assertEquals(self.dbenvClient.rep_get_timeout( + self.assertEqual(self.dbenvClient.rep_get_timeout( db.DB_REP_ELECTION_TIMEOUT), 100432) self.dbenvMaster.rep_set_timeout(db.DB_REP_ELECTION_RETRY, 100345) self.dbenvClient.rep_set_timeout(db.DB_REP_ELECTION_RETRY, 100543) - self.assertEquals(self.dbenvMaster.rep_get_timeout( + self.assertEqual(self.dbenvMaster.rep_get_timeout( db.DB_REP_ELECTION_RETRY), 100345) - self.assertEquals(self.dbenvClient.rep_get_timeout( + self.assertEqual(self.dbenvClient.rep_get_timeout( db.DB_REP_ELECTION_RETRY), 100543) self.dbenvMaster.repmgr_set_ack_policy(db.DB_REPMGR_ACKS_ALL) @@ -113,13 +113,13 @@ class DBReplicationManager(DBReplication) : self.dbenvMaster.repmgr_start(1, db.DB_REP_MASTER); self.dbenvClient.repmgr_start(1, db.DB_REP_CLIENT); - self.assertEquals(self.dbenvMaster.rep_get_nsites(),2) - self.assertEquals(self.dbenvClient.rep_get_nsites(),2) - self.assertEquals(self.dbenvMaster.rep_get_priority(),10) - self.assertEquals(self.dbenvClient.rep_get_priority(),0) - self.assertEquals(self.dbenvMaster.repmgr_get_ack_policy(), + self.assertEqual(self.dbenvMaster.rep_get_nsites(),2) + self.assertEqual(self.dbenvClient.rep_get_nsites(),2) + self.assertEqual(self.dbenvMaster.rep_get_priority(),10) + self.assertEqual(self.dbenvClient.rep_get_priority(),0) + self.assertEqual(self.dbenvMaster.repmgr_get_ack_policy(), db.DB_REPMGR_ACKS_ALL) - self.assertEquals(self.dbenvClient.repmgr_get_ack_policy(), + self.assertEqual(self.dbenvClient.repmgr_get_ack_policy(), db.DB_REPMGR_ACKS_ALL) # The timeout is necessary in BDB 4.5, since DB_EVENT_REP_STARTUPDONE @@ -143,16 +143,16 @@ class DBReplicationManager(DBReplication) : startup_timeout = True d = self.dbenvMaster.repmgr_site_list() - self.assertEquals(len(d), 1) - self.assertEquals(d[0][0], "127.0.0.1") - self.assertEquals(d[0][1], client_port) + self.assertEqual(len(d), 1) + self.assertEqual(d[0][0], "127.0.0.1") + self.assertEqual(d[0][1], client_port) self.assertTrue((d[0][2]==db.DB_REPMGR_CONNECTED) or \ (d[0][2]==db.DB_REPMGR_DISCONNECTED)) d = self.dbenvClient.repmgr_site_list() - self.assertEquals(len(d), 1) - self.assertEquals(d[0][0], "127.0.0.1") - self.assertEquals(d[0][1], master_port) + self.assertEqual(len(d), 1) + self.assertEqual(d[0][0], "127.0.0.1") + self.assertEqual(d[0][1], master_port) self.assertTrue((d[0][2]==db.DB_REPMGR_CONNECTED) or \ (d[0][2]==db.DB_REPMGR_DISCONNECTED)) @@ -207,7 +207,7 @@ class DBReplicationManager(DBReplication) : self.skipTest("replication test skipped due to random failure, " "see issue 3892") self.assertTrue(time.time()<timeout) - self.assertEquals("123", v) + self.assertEqual("123", v) txn=self.dbenvMaster.txn_begin() self.dbMaster.delete("ABC", txn=txn) @@ -220,7 +220,7 @@ class DBReplicationManager(DBReplication) : if v is None : time.sleep(0.02) self.assertTrue(time.time()<timeout) - self.assertEquals(None, v) + self.assertEqual(None, v) class DBBaseReplication(DBReplication) : def setUp(self) : @@ -253,8 +253,8 @@ class DBBaseReplication(DBReplication) : self.dbenvClient.rep_set_transport(3,c2m) self.dbenvClient.rep_set_priority(0) - self.assertEquals(self.dbenvMaster.rep_get_priority(),10) - self.assertEquals(self.dbenvClient.rep_get_priority(),0) + self.assertEqual(self.dbenvMaster.rep_get_priority(),10) + self.assertEqual(self.dbenvClient.rep_get_priority(),0) #self.dbenvMaster.set_verbose(db.DB_VERB_REPLICATION, True) #self.dbenvMaster.set_verbose(db.DB_VERB_FILEOPS_ALL, True) @@ -384,7 +384,7 @@ class DBBaseReplication(DBReplication) : if v is None : time.sleep(0.02) self.assertTrue(time.time()<timeout) - self.assertEquals("123", v) + self.assertEqual("123", v) txn=self.dbenvMaster.txn_begin() self.dbMaster.delete("ABC", txn=txn) @@ -397,7 +397,7 @@ class DBBaseReplication(DBReplication) : if v is None : time.sleep(0.02) self.assertTrue(time.time()<timeout) - self.assertEquals(None, v) + self.assertEqual(None, v) if db.version() >= (4,7) : def test02_test_request(self) : diff --git a/Lib/bsddb/test/test_sequence.py b/Lib/bsddb/test/test_sequence.py index cad598b..3d3ee29 100644 --- a/Lib/bsddb/test/test_sequence.py +++ b/Lib/bsddb/test/test_sequence.py @@ -37,53 +37,53 @@ class DBSequenceTest(unittest.TestCase): self.seq = db.DBSequence(self.d, flags=0) start_value = 10 * self.int_32_max self.assertEqual(0xA00000000, start_value) - self.assertEquals(None, self.seq.initial_value(start_value)) - self.assertEquals(None, self.seq.open(key='id', txn=None, flags=db.DB_CREATE)) - self.assertEquals(start_value, self.seq.get(5)) - self.assertEquals(start_value + 5, self.seq.get()) + self.assertEqual(None, self.seq.initial_value(start_value)) + self.assertEqual(None, self.seq.open(key='id', txn=None, flags=db.DB_CREATE)) + self.assertEqual(start_value, self.seq.get(5)) + self.assertEqual(start_value + 5, self.seq.get()) def test_remove(self): self.seq = db.DBSequence(self.d, flags=0) - self.assertEquals(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE)) - self.assertEquals(None, self.seq.remove(txn=None, flags=0)) + self.assertEqual(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE)) + self.assertEqual(None, self.seq.remove(txn=None, flags=0)) del self.seq def test_get_key(self): self.seq = db.DBSequence(self.d, flags=0) key = 'foo' - self.assertEquals(None, self.seq.open(key=key, txn=None, flags=db.DB_CREATE)) - self.assertEquals(key, self.seq.get_key()) + self.assertEqual(None, self.seq.open(key=key, txn=None, flags=db.DB_CREATE)) + self.assertEqual(key, self.seq.get_key()) def test_get_dbp(self): self.seq = db.DBSequence(self.d, flags=0) - self.assertEquals(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE)) - self.assertEquals(self.d, self.seq.get_dbp()) + self.assertEqual(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE)) + self.assertEqual(self.d, self.seq.get_dbp()) def test_cachesize(self): self.seq = db.DBSequence(self.d, flags=0) cashe_size = 10 - self.assertEquals(None, self.seq.set_cachesize(cashe_size)) - self.assertEquals(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE)) - self.assertEquals(cashe_size, self.seq.get_cachesize()) + self.assertEqual(None, self.seq.set_cachesize(cashe_size)) + self.assertEqual(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE)) + self.assertEqual(cashe_size, self.seq.get_cachesize()) def test_flags(self): self.seq = db.DBSequence(self.d, flags=0) flag = db.DB_SEQ_WRAP; - self.assertEquals(None, self.seq.set_flags(flag)) - self.assertEquals(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE)) - self.assertEquals(flag, self.seq.get_flags() & flag) + self.assertEqual(None, self.seq.set_flags(flag)) + self.assertEqual(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE)) + self.assertEqual(flag, self.seq.get_flags() & flag) def test_range(self): self.seq = db.DBSequence(self.d, flags=0) seq_range = (10 * self.int_32_max, 11 * self.int_32_max - 1) - self.assertEquals(None, self.seq.set_range(seq_range)) + self.assertEqual(None, self.seq.set_range(seq_range)) self.seq.initial_value(seq_range[0]) - self.assertEquals(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE)) - self.assertEquals(seq_range, self.seq.get_range()) + self.assertEqual(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE)) + self.assertEqual(seq_range, self.seq.get_range()) def test_stat(self): self.seq = db.DBSequence(self.d, flags=0) - self.assertEquals(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE)) + self.assertEqual(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE)) stat = self.seq.stat() for param in ('nowait', 'min', 'max', 'value', 'current', 'flags', 'cache_size', 'last_value', 'wait'): @@ -106,24 +106,24 @@ class DBSequenceTest(unittest.TestCase): def test_64bits(self) : # We don't use both extremes because they are problematic value_plus=(1L<<63)-2 - self.assertEquals(9223372036854775806L,value_plus) + self.assertEqual(9223372036854775806L,value_plus) value_minus=(-1L<<63)+1 # Two complement - self.assertEquals(-9223372036854775807L,value_minus) + self.assertEqual(-9223372036854775807L,value_minus) self.seq = db.DBSequence(self.d, flags=0) - self.assertEquals(None, self.seq.initial_value(value_plus-1)) - self.assertEquals(None, self.seq.open(key='id', txn=None, + self.assertEqual(None, self.seq.initial_value(value_plus-1)) + self.assertEqual(None, self.seq.open(key='id', txn=None, flags=db.DB_CREATE)) - self.assertEquals(value_plus-1, self.seq.get(1)) - self.assertEquals(value_plus, self.seq.get(1)) + self.assertEqual(value_plus-1, self.seq.get(1)) + self.assertEqual(value_plus, self.seq.get(1)) self.seq.remove(txn=None, flags=0) self.seq = db.DBSequence(self.d, flags=0) - self.assertEquals(None, self.seq.initial_value(value_minus)) - self.assertEquals(None, self.seq.open(key='id', txn=None, + self.assertEqual(None, self.seq.initial_value(value_minus)) + self.assertEqual(None, self.seq.open(key='id', txn=None, flags=db.DB_CREATE)) - self.assertEquals(value_minus, self.seq.get(1)) - self.assertEquals(value_minus+1, self.seq.get(1)) + self.assertEqual(value_minus, self.seq.get(1)) + self.assertEqual(value_minus+1, self.seq.get(1)) def test_multiple_close(self): self.seq = db.DBSequence(self.d) |