[Zodb-checkins] SVN: ZODB/branches/efge-beforeCommitHook/src/transaction/tests/test_transaction.py Make test check that subtransactions commits don't call the hook.

Florent Guillaume fg at nuxeo.com
Wed Apr 6 10:19:23 EDT 2005


Log message for revision 29887:
  Make test check that subtransactions commits don't call the hook.
  

Changed:
  U   ZODB/branches/efge-beforeCommitHook/src/transaction/tests/test_transaction.py

-=-
Modified: ZODB/branches/efge-beforeCommitHook/src/transaction/tests/test_transaction.py
===================================================================
--- ZODB/branches/efge-beforeCommitHook/src/transaction/tests/test_transaction.py	2005-04-06 14:07:24 UTC (rev 29886)
+++ ZODB/branches/efge-beforeCommitHook/src/transaction/tests/test_transaction.py	2005-04-06 14:19:23 UTC (rev 29887)
@@ -660,6 +660,18 @@
       ['hook1']
       >>> reset_log()
 
+    The hook is only called for a full commit, not for subtransactions.
+
+      >>> t = manager.begin()
+      >>> t.beforeCommitHook(hook, 'A')
+      >>> t.commit(subtransaction=True)
+      >>> log
+      []
+      >>> t.commit()
+      >>> log
+      ['hookA']
+      >>> reset_log()
+
     The hook is called before the commit does anything, so even if the
     commit fails the hook will have been called. To provoke failures in
     commit, we'll add failing resource manager to the transaction.



More information about the Zodb-checkins mailing list