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