Commit 6cd069dc authored by Marius Gedminas's avatar Marius Gedminas

Use the testXXX convention for test names

parent 338536e8
...@@ -51,7 +51,7 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase): ...@@ -51,7 +51,7 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase):
self.datamgr.open() self.datamgr.open()
self.transaction = StubTransaction() self.transaction = StubTransaction()
def check_add(self): def test_add(self):
from ZODB.POSException import InvalidObjectReference from ZODB.POSException import InvalidObjectReference
obj = StubObject() obj = StubObject()
self.assertTrue(obj._p_oid is None) self.assertTrue(obj._p_oid is None)
...@@ -75,7 +75,7 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase): ...@@ -75,7 +75,7 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase):
obj2._p_jar = object() obj2._p_jar = object()
self.assertRaises(InvalidObjectReference, self.datamgr.add, obj2) self.assertRaises(InvalidObjectReference, self.datamgr.add, obj2)
def checkResetOnAbort(self): def testResetOnAbort(self):
# Check that _p_oid and _p_jar are reset when a transaction is # Check that _p_oid and _p_jar are reset when a transaction is
# aborted. # aborted.
obj = StubObject() obj = StubObject()
...@@ -86,7 +86,7 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase): ...@@ -86,7 +86,7 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase):
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)
def checkResetOnTpcAbort(self): def testResetOnTpcAbort(self):
obj = StubObject() obj = StubObject()
self.datamgr.add(obj) self.datamgr.add(obj)
oid = obj._p_oid oid = obj._p_oid
...@@ -101,7 +101,7 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase): ...@@ -101,7 +101,7 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase):
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)
def checkTpcAbortAfterCommit(self): def testTpcAbortAfterCommit(self):
obj = StubObject() obj = StubObject()
self.datamgr.add(obj) self.datamgr.add(obj)
oid = obj._p_oid oid = obj._p_oid
...@@ -114,7 +114,7 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase): ...@@ -114,7 +114,7 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase):
self.assertRaises(KeyError, self.datamgr.get, oid) self.assertRaises(KeyError, self.datamgr.get, oid)
self.assertEqual(self.db.storage._stored, [oid]) self.assertEqual(self.db.storage._stored, [oid])
def checkCommit(self): def testCommit(self):
obj = StubObject() obj = StubObject()
self.datamgr.add(obj) self.datamgr.add(obj)
oid = obj._p_oid oid = obj._p_oid
...@@ -130,7 +130,7 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase): ...@@ -130,7 +130,7 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase):
self.assertEqual(self.db.storage._stored, [oid]) self.assertEqual(self.db.storage._stored, [oid])
self.assertEqual(self.db.storage._finished, [oid]) self.assertEqual(self.db.storage._finished, [oid])
def checkModifyOnGetstate(self): def testModifyOnGetstate(self):
member = StubObject() member = StubObject()
subobj = StubObject() subobj = StubObject()
subobj.member = member subobj.member = member
...@@ -147,7 +147,7 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase): ...@@ -147,7 +147,7 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase):
"member was not stored") "member was not stored")
self.assertTrue(self.datamgr._added_during_commit is None) self.assertTrue(self.datamgr._added_during_commit is None)
def checkUnusedAddWorks(self): def testUnusedAddWorks(self):
# When an object is added, but not committed, it shouldn't be stored, # When an object is added, but not committed, it shouldn't be stored,
# but also it should be an error. # but also it should be an error.
obj = StubObject() obj = StubObject()
...@@ -156,7 +156,7 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase): ...@@ -156,7 +156,7 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase):
self.datamgr.tpc_finish(self.transaction) self.datamgr.tpc_finish(self.transaction)
self.assertTrue(obj._p_oid not in self.datamgr._storage._stored) self.assertTrue(obj._p_oid not in self.datamgr._storage._stored)
def check__resetCacheResetsReader(self): def test__resetCacheResetsReader(self):
# https://bugs.launchpad.net/zodb/+bug/142667 # https://bugs.launchpad.net/zodb/+bug/142667
old_cache = self.datamgr._cache old_cache = self.datamgr._cache
self.datamgr._resetCache() self.datamgr._resetCache()
...@@ -1289,7 +1289,7 @@ class StubDatabase: ...@@ -1289,7 +1289,7 @@ class StubDatabase:
large_record_size = 1<<30 large_record_size = 1<<30
def test_suite(): def test_suite():
s = unittest.makeSuite(ConnectionDotAdd, 'check') s = unittest.makeSuite(ConnectionDotAdd)
s.addTest(doctest.DocTestSuite(checker=checker)) s.addTest(doctest.DocTestSuite(checker=checker))
s.addTest(unittest.makeSuite(TestConnectionInterface)) s.addTest(unittest.makeSuite(TestConnectionInterface))
s.addTest(unittest.makeSuite(EstimatedSizeTests)) s.addTest(unittest.makeSuite(EstimatedSizeTests))
......
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