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