[Neo-report] r2154 gregory - in /trunk/neo/tests: master/ storage/
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Jun 11 09:56:39 CEST 2010
Author: gregory
Date: Fri Jun 11 09:56:35 2010
New Revision: 2154
Log:
Check that repr() on transaction objects will not raise.
Modified:
trunk/neo/tests/master/testTransactions.py
trunk/neo/tests/storage/testTransactions.py
Modified: trunk/neo/tests/master/testTransactions.py
==============================================================================
--- trunk/neo/tests/master/testTransactions.py [iso-8859-1] (original)
+++ trunk/neo/tests/master/testTransactions.py [iso-8859-1] Fri Jun 11 09:56:35 2010
@@ -35,7 +35,7 @@ class testTransactionManager(NeoTestBase
def testTransaction(self):
# test data
- node = Mock({})
+ node = Mock({'__repr__': 'Node'})
tid = self.makeTID(1)
oid_list = (oid1, oid2) = (self.makeOID(1), self.makeOID(2))
uuid_list = (uuid1, uuid2) = (self.makeUUID(1), self.makeUUID(2))
@@ -47,6 +47,8 @@ class testTransactionManager(NeoTestBase
# lock nodes one by one
self.assertFalse(txn.lock(uuid1))
self.assertTrue(txn.lock(uuid2))
+ # check that repr() works
+ repr(txn)
def testManager(self):
# test data
Modified: trunk/neo/tests/storage/testTransactions.py
==============================================================================
--- trunk/neo/tests/storage/testTransactions.py [iso-8859-1] (original)
+++ trunk/neo/tests/storage/testTransactions.py [iso-8859-1] Fri Jun 11 09:56:35 2010
@@ -34,6 +34,13 @@ class TransactionTests(NeoTestBase):
self.assertEqual(txn.getObjectList(), [])
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):
txn = Transaction(self.getNewUUID(), self.getNextTID())
self.assertFalse(txn.isLocked())
More information about the Neo-report
mailing list