Commit 5e9c7810 authored by Tres Seaver's avatar Tres Seaver

Fix Py3k namnyisms: 'assertEquals' -> 'assertEqual'.

parent 690c699c
...@@ -898,7 +898,7 @@ class MonteCarloTests(unittest.TestCase): ...@@ -898,7 +898,7 @@ class MonteCarloTests(unittest.TestCase):
g.close() g.close()
msg = ("guts don't match\ncorrectpath=%r when=%r\n cmd=%r" % msg = ("guts don't match\ncorrectpath=%r when=%r\n cmd=%r" %
(correctpath, when, ' '.join(argv))) (correctpath, when, ' '.join(argv)))
self.assertEquals(fguts, gguts, msg) self.assertEqual(fguts, gguts, msg)
def test_suite(): def test_suite():
......
...@@ -138,22 +138,22 @@ class IteratorStorage(IteratorCompare): ...@@ -138,22 +138,22 @@ class IteratorStorage(IteratorCompare):
def checkIterateRepeatedly(self): def checkIterateRepeatedly(self):
self._dostore() self._dostore()
transactions = self._storage.iterator() transactions = self._storage.iterator()
self.assertEquals(1, len(list(transactions))) self.assertEqual(1, len(list(transactions)))
# The iterator can only be consumed once: # The iterator can only be consumed once:
self.assertEquals(0, len(list(transactions))) self.assertEqual(0, len(list(transactions)))
def checkIterateRecordsRepeatedly(self): def checkIterateRecordsRepeatedly(self):
self._dostore() self._dostore()
tinfo = next(self._storage.iterator()) tinfo = next(self._storage.iterator())
self.assertEquals(1, len(list(tinfo))) self.assertEqual(1, len(list(tinfo)))
self.assertEquals(1, len(list(tinfo))) self.assertEqual(1, len(list(tinfo)))
def checkIterateWhileWriting(self): def checkIterateWhileWriting(self):
self._dostore() self._dostore()
iterator = self._storage.iterator() iterator = self._storage.iterator()
# We have one transaction with 1 modified object. # We have one transaction with 1 modified object.
txn_1 = next(iterator) txn_1 = next(iterator)
self.assertEquals(1, len(list(txn_1))) self.assertEqual(1, len(list(txn_1)))
# We store another transaction with 1 object, the already running # We store another transaction with 1 object, the already running
# iterator does not pick this up. # iterator does not pick this up.
......
...@@ -45,5 +45,5 @@ class PersistentStorage: ...@@ -45,5 +45,5 @@ class PersistentStorage:
# keep copies of all the objects # keep copies of all the objects
for oid, ver, p, s in objects: for oid, ver, p, s in objects:
_p, _s = self._storage.load(oid, ver) _p, _s = self._storage.load(oid, ver)
self.assertEquals(p, _p) self.assertEqual(p, _p)
self.assertEquals(s, _s) self.assertEqual(s, _s)
...@@ -131,8 +131,8 @@ class RecoveryStorage(IteratorDeepCompare): ...@@ -131,8 +131,8 @@ class RecoveryStorage(IteratorDeepCompare):
transaction.commit() transaction.commit()
r = db.open().root() r = db.open().root()
self.assertEquals(r["obj1"].x, 'x1') self.assertEqual(r["obj1"].x, 'x1')
self.assertEquals(r["obj2"].x, 'x2') self.assertEqual(r["obj2"].x, 'x2')
# Dirty tricks. # Dirty tricks.
if is_filestorage: if is_filestorage:
...@@ -176,8 +176,8 @@ class RecoveryStorage(IteratorDeepCompare): ...@@ -176,8 +176,8 @@ class RecoveryStorage(IteratorDeepCompare):
self._storage.tpc_finish(t) self._storage.tpc_finish(t)
r = db.open().root() r = db.open().root()
self.assertEquals(r["obj1"].x, 'x1') self.assertEqual(r["obj1"].x, 'x1')
self.assertEquals(r["obj2"].x, 'x2') self.assertEqual(r["obj2"].x, 'x2')
if is_filestorage: if is_filestorage:
# Again _data_find should find both objects in this txn, and # Again _data_find should find both objects in this txn, and
......
...@@ -240,18 +240,18 @@ class LRUCacheTests(CacheTestBase): ...@@ -240,18 +240,18 @@ class LRUCacheTests(CacheTestBase):
for i in range(CONNS): for i in range(CONNS):
self.noodle_new_connection() self.noodle_new_connection()
self.assertEquals(self.db.cacheSize(), CACHE_SIZE * CONNS) self.assertEqual(self.db.cacheSize(), CACHE_SIZE * CONNS)
details = self.db.cacheDetailSize() details = self.db.cacheDetailSize()
self.assertEquals(len(details), CONNS) self.assertEqual(len(details), CONNS)
for d in details: for d in details:
self.assertEquals(d['ngsize'], CACHE_SIZE) self.assertEqual(d['ngsize'], CACHE_SIZE)
# The assertion below is non-sensical # The assertion below is non-sensical
# The (poorly named) cache size is a target for non-ghosts. # The (poorly named) cache size is a target for non-ghosts.
# The cache *usually* contains non-ghosts, so that the # The cache *usually* contains non-ghosts, so that the
# size normally exceeds the target size. # size normally exceeds the target size.
#self.assertEquals(d['size'], CACHE_SIZE) #self.assertEqual(d['size'], CACHE_SIZE)
def testDetail(self): def testDetail(self):
CACHE_SIZE = 10 CACHE_SIZE = 10
......
...@@ -112,7 +112,7 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase): ...@@ -112,7 +112,7 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase):
self.assertTrue(obj._p_oid is None) self.assertTrue(obj._p_oid is None)
self.assertTrue(obj._p_jar is None) self.assertTrue(obj._p_jar is None)
self.assertRaises(KeyError, self.datamgr.get, oid) self.assertRaises(KeyError, self.datamgr.get, oid)
self.assertEquals(self.db.storage._stored, [oid]) self.assertEqual(self.db.storage._stored, [oid])
def checkCommit(self): def checkCommit(self):
obj = StubObject() obj = StubObject()
...@@ -127,8 +127,8 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase): ...@@ -127,8 +127,8 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase):
# This next assertTrue is covered by an assert in tpc_finish. # This next assertTrue is covered by an assert in tpc_finish.
##self.assertTrue(not self.datamgr._added) ##self.assertTrue(not self.datamgr._added)
self.assertEquals(self.db.storage._stored, [oid]) self.assertEqual(self.db.storage._stored, [oid])
self.assertEquals(self.db.storage._finished, [oid]) self.assertEqual(self.db.storage._finished, [oid])
def checkModifyOnGetstate(self): def checkModifyOnGetstate(self):
member = StubObject() member = StubObject()
......
...@@ -48,17 +48,17 @@ class TestUtils(unittest.TestCase): ...@@ -48,17 +48,17 @@ class TestUtils(unittest.TestCase):
for num in self.all: for num in self.all:
s = p64(num) s = p64(num)
n = U64(s) n = U64(s)
self.assertEquals(num, n, "U64() failed") self.assertEqual(num, n, "U64() failed")
n2 = u64(s) n2 = u64(s)
self.assertEquals(num, n2, "u64() failed") self.assertEqual(num, n2, "u64() failed")
def checkKnownConstants(self): def checkKnownConstants(self):
self.assertEquals(b"\000\000\000\000\000\000\000\001", p64(1)) self.assertEqual(b"\000\000\000\000\000\000\000\001", p64(1))
self.assertEquals(b"\000\000\000\001\000\000\000\000", p64(1<<32)) self.assertEqual(b"\000\000\000\001\000\000\000\000", p64(1<<32))
self.assertEquals(u64(b"\000\000\000\000\000\000\000\001"), 1) self.assertEqual(u64(b"\000\000\000\000\000\000\000\001"), 1)
self.assertEquals(U64(b"\000\000\000\000\000\000\000\001"), 1) self.assertEqual(U64(b"\000\000\000\000\000\000\000\001"), 1)
self.assertEquals(u64(b"\000\000\000\001\000\000\000\000"), 1<<32) self.assertEqual(u64(b"\000\000\000\001\000\000\000\000"), 1<<32)
self.assertEquals(U64(b"\000\000\000\001\000\000\000\000"), 1<<32) self.assertEqual(U64(b"\000\000\000\001\000\000\000\000"), 1<<32)
def checkPersistentIdHandlesDescriptor(self): def checkPersistentIdHandlesDescriptor(self):
from ZODB.serialize import ObjectWriter from ZODB.serialize import ObjectWriter
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment