Commit fea037dc authored by Grégory Wisniewski's avatar Grégory Wisniewski

Check that repr() on transaction objects will not raise.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2154 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 00381074
...@@ -35,7 +35,7 @@ class testTransactionManager(NeoTestBase): ...@@ -35,7 +35,7 @@ class testTransactionManager(NeoTestBase):
def testTransaction(self): def testTransaction(self):
# test data # test data
node = Mock({}) node = Mock({'__repr__': 'Node'})
tid = self.makeTID(1) tid = self.makeTID(1)
oid_list = (oid1, oid2) = (self.makeOID(1), self.makeOID(2)) oid_list = (oid1, oid2) = (self.makeOID(1), self.makeOID(2))
uuid_list = (uuid1, uuid2) = (self.makeUUID(1), self.makeUUID(2)) uuid_list = (uuid1, uuid2) = (self.makeUUID(1), self.makeUUID(2))
...@@ -47,6 +47,8 @@ class testTransactionManager(NeoTestBase): ...@@ -47,6 +47,8 @@ class testTransactionManager(NeoTestBase):
# lock nodes one by one # lock nodes one by one
self.assertFalse(txn.lock(uuid1)) self.assertFalse(txn.lock(uuid1))
self.assertTrue(txn.lock(uuid2)) self.assertTrue(txn.lock(uuid2))
# check that repr() works
repr(txn)
def testManager(self): def testManager(self):
# test data # test data
......
...@@ -34,6 +34,13 @@ class TransactionTests(NeoTestBase): ...@@ -34,6 +34,13 @@ class TransactionTests(NeoTestBase):
self.assertEqual(txn.getObjectList(), []) self.assertEqual(txn.getObjectList(), [])
self.assertEqual(txn.getOIDList(), []) self.assertEqual(txn.getOIDList(), [])
def testRepr(self):
""" Just check if the __repr__ implementation will not raise """
uuid = self.getNewUUID()
tid = self.getNextTID()
txn = Transaction(uuid, tid)
repr(txn)
def testLock(self): def testLock(self):
txn = Transaction(self.getNewUUID(), self.getNextTID()) txn = Transaction(self.getNewUUID(), self.getNextTID())
self.assertFalse(txn.isLocked()) self.assertFalse(txn.isLocked())
......
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