[Zodb-checkins] SVN: ZODB/trunk/src/ZODB/tests/testConnectionSavepoint.py Added test to make sure we can't close a connection with an active

Jim Fulton jim at zope.com
Wed Jun 15 19:20:19 EDT 2005


Log message for revision 30807:
  Added test to make sure we can't close a connection with an active
  savepoint.
  

Changed:
  U   ZODB/trunk/src/ZODB/tests/testConnectionSavepoint.py

-=-
Modified: ZODB/trunk/src/ZODB/tests/testConnectionSavepoint.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/testConnectionSavepoint.py	2005-06-15 05:17:17 UTC (rev 30806)
+++ ZODB/trunk/src/ZODB/tests/testConnectionSavepoint.py	2005-06-15 23:20:19 UTC (rev 30807)
@@ -70,6 +70,23 @@
     >>> transaction.commit()
 """
 
+def testCantCloseConnectionWithActiveSavepoint():
+    """
+    >>> import ZODB.tests.util
+    >>> db = ZODB.tests.util.DB()
+    >>> connection = db.open()
+    >>> root = connection.root()
+    >>> root['a'] = 1
+    >>> sp = transaction.savepoint()
+    >>> connection.close()
+    Traceback (most recent call last):
+    ...
+    ConnectionStateError: Cannot close a connection joined to a transaction
+
+    >>> db.close()
+    """
+    
+
 def test_suite():
     return unittest.TestSuite((
         doctest.DocFileSuite('testConnectionSavepoint.txt'),



More information about the Zodb-checkins mailing list