Commit 8b7702b7 authored by Julien Muchembled's avatar Julien Muchembled

tests: use assert{False,True} instead of assertEqual(..., {False,True})

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2694 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 4458b7e5
......@@ -367,7 +367,7 @@ class StorageDBTests(NeoUnitTestBase):
self.assertEqual(self.db.getObject(oid1, tid=tid1), None)
self.assertEqual(self.db.getObject(oid1, tid=tid2), None)
self.db.deleteObject(oid2, serial=tid1)
self.assertEqual(self.db.getObject(oid2, tid=tid1), False)
self.assertFalse(self.db.getObject(oid2, tid=tid1))
self.assertEqual(self.db.getObject(oid2, tid=tid2), (tid2, None) + \
objs2[1][1:])
......@@ -391,8 +391,8 @@ class StorageDBTests(NeoUnitTestBase):
# Right partition, below cutoff
self.assertNotEqual(self.db.getObject(oid1, tid=tid1), None)
# Right partition, above tid cutoff
self.assertEqual(self.db.getObject(oid1, tid=tid2), False)
self.assertEqual(self.db.getObject(oid1, tid=tid3), False)
self.assertFalse(self.db.getObject(oid1, tid=tid2))
self.assertFalse(self.db.getObject(oid1, tid=tid3))
# Wrong partition, above cutoff
self.assertNotEqual(self.db.getObject(oid2, tid=tid1), None)
self.assertNotEqual(self.db.getObject(oid2, tid=tid2), None)
......
......@@ -51,22 +51,22 @@ class StorageMySQSLdbTests(StorageDBTests):
self.assertEquals(db.user, NEO_SQL_USER)
# & connect
self.assertTrue(isinstance(db.conn, MySQLdb.connection))
self.assertEquals(db.isUnderTransaction(), False)
self.assertFalse(db.isUnderTransaction())
def test_begin(self):
# no current transaction
self.db.conn = Mock({ })
self.assertEquals(self.db.isUnderTransaction(), False)
self.assertFalse(self.db.isUnderTransaction())
self.db.begin()
self.checkCalledQuery(query='COMMIT')
self.assertEquals(self.db.isUnderTransaction(), True)
self.assertTrue(self.db.isUnderTransaction())
def test_commit(self):
self.db.conn = Mock()
self.db.begin()
self.db.commit()
self.assertEquals(len(self.db.conn.mockGetNamedCalls('commit')), 1)
self.assertEquals(self.db.isUnderTransaction(), False)
self.assertFalse(self.db.isUnderTransaction())
def test_rollback(self):
# rollback called and no current transaction
......@@ -74,7 +74,7 @@ class StorageMySQSLdbTests(StorageDBTests):
self.db.under_transaction = True
self.db.rollback()
self.assertEquals(len(self.db.conn.mockGetNamedCalls('rollback')), 1)
self.assertEquals(self.db.isUnderTransaction(), False)
self.assertFalse(self.db.isUnderTransaction())
def test_query1(self):
# fake result object
......
......@@ -202,7 +202,7 @@ class StorageVerificationHandlerTests(NeoUnitTestBase):
self.assertEqual(user, 'u2')
self.assertEqual(desc, 'd2')
self.assertEqual(ext, 'e2')
self.assertEqual(packed, False)
self.assertFalse(packed)
self.assertEqual(len(oid_list), 1)
self.assertEqual(u64(oid_list[0]), 2)
......
......@@ -195,7 +195,7 @@ class ConnectionTests(NeoUnitTestBase):
self._checkReadBuf(bc, '')
self._checkWriteBuf(bc, '')
self.assertEqual(bc.cur_id, 0)
self.assertEqual(bc.aborted, False)
self.assertFalse(bc.aborted)
# test uuid
self.assertEqual(bc.uuid, None)
self.assertEqual(bc.getUUID(), None)
......@@ -216,7 +216,7 @@ class ConnectionTests(NeoUnitTestBase):
self.assertEqual(next_id, 0)
# test abort
bc.abort()
self.assertEqual(bc.aborted, True)
self.assertTrue(bc.aborted)
self.assertFalse(bc.isServer())
def test_Connection_pending(self):
......@@ -784,7 +784,7 @@ class ConnectionTests(NeoUnitTestBase):
self._checkReadBuf(bc, '')
self._checkWriteBuf(bc, '')
self.assertEqual(bc.cur_id, 0)
self.assertEqual(bc.aborted, False)
self.assertFalse(bc.aborted)
# test uuid
self.assertEqual(bc.uuid, None)
self.assertEqual(bc.getUUID(), None)
......@@ -805,7 +805,7 @@ class ConnectionTests(NeoUnitTestBase):
self.assertEqual(next_id, 0)
# test abort
bc.abort()
self.assertEqual(bc.aborted, True)
self.assertTrue(bc.aborted)
self.assertTrue(bc.isServer())
class MTConnectionTests(ConnectionTests):
......
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