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

Add missing test for commit()


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@380 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 5a55c98d
...@@ -96,6 +96,13 @@ class StorageMySQSLdbTests(unittest.TestCase): ...@@ -96,6 +96,13 @@ class StorageMySQSLdbTests(unittest.TestCase):
self.checkCalledQuery(query='COMMIT') self.checkCalledQuery(query='COMMIT')
self.assertEquals(self.db.under_transaction, True) self.assertEquals(self.db.under_transaction, True)
def test_06_commit(self):
self.db.conn = Mock()
self.db.under_transaction = True
self.db.commit()
self.assertEquals(len(self.db.conn.mockGetNamedCalls('commit')), 1)
selg.assertEquals(serlf.db.under_transaction, False)
def test_06_rollback(self): def test_06_rollback(self):
# rollback called and no current transaction # rollback called and no current transaction
self.db.conn = Mock({ }) self.db.conn = Mock({ })
......
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