[Zodb-checkins] SVN: ZODB/branches/anguenot-after_commit_hooks/src/transaction/tests/test_transaction.py Add a test showing that the transaction manager freeing task has been done in case of after commit hooks registration

Julien Anguenot ja at nuxeo.com
Tue Dec 20 21:19:55 EST 2005


Log message for revision 40936:
  Add a test showing that the transaction manager freeing task has been done in case of after commit hooks registration

Changed:
  U   ZODB/branches/anguenot-after_commit_hooks/src/transaction/tests/test_transaction.py

-=-
Modified: ZODB/branches/anguenot-after_commit_hooks/src/transaction/tests/test_transaction.py
===================================================================
--- ZODB/branches/anguenot-after_commit_hooks/src/transaction/tests/test_transaction.py	2005-12-21 01:50:51 UTC (rev 40935)
+++ ZODB/branches/anguenot-after_commit_hooks/src/transaction/tests/test_transaction.py	2005-12-21 02:19:54 UTC (rev 40936)
@@ -871,7 +871,7 @@
 
     The transaction is already committed when the after commit hooks
     will be executed. Executing the hooks must not have further
-    effects. 
+    effects.
 
     TODO
 
@@ -895,8 +895,24 @@
       >>> log
       ["True arg '-' kw1 1 kw2 'no_kw2'", "True arg '-' kw1 3 kw2 'no_kw2'"]
 
+    Test that the assiated transaction manager has been cleanup when
+    after commit hooks are registred
+
+      >>> mgr = transaction.TransactionManager()
+      >>> do = DataObject(mgr)
+
+      >>> t = transaction.begin()
+      >>> len(t._manager._txns)
+      1
+
+      >>> t.addAfterCommitHook(hook, ('-', 1))
+      >>> transaction.commit()
+
+      >>> len(t._manager._txns)
+      0
+
     """
-       
+
 def test_suite():
     from zope.testing.doctest import DocTestSuite
     return unittest.TestSuite((



More information about the Zodb-checkins mailing list