[Zope-Checkins] SVN: Zope/branches/gotcha-processlifetime/src/Zope2/App/tests/test_startup.py also tests events are correctly populated

Godefroid Chapelle gotcha at bubblenet.be
Sun Jun 27 07:09:01 EDT 2010


Log message for revision 113922:
  also tests events are correctly populated

Changed:
  U   Zope/branches/gotcha-processlifetime/src/Zope2/App/tests/test_startup.py

-=-
Modified: Zope/branches/gotcha-processlifetime/src/Zope2/App/tests/test_startup.py
===================================================================
--- Zope/branches/gotcha-processlifetime/src/Zope2/App/tests/test_startup.py	2010-06-27 10:29:00 UTC (rev 113921)
+++ Zope/branches/gotcha-processlifetime/src/Zope2/App/tests/test_startup.py	2010-06-27 11:09:01 UTC (rev 113922)
@@ -20,12 +20,32 @@
 logged = """Zope2.App.test_startup INFO
   <class 'zope.processlifetime.DatabaseOpened'>
 Zope2.App.test_startup INFO
-  <class 'zope.processlifetime.DatabaseOpenedWithRoot'>"""
+  <class 'ZODB.DB.DB'>
+Zope2.App.test_startup INFO
+  Root not ready.
+Zope2.App.test_startup INFO
+  <class 'zope.processlifetime.DatabaseOpenedWithRoot'>
+Zope2.App.test_startup INFO
+  <class 'ZODB.DB.DB'>
+Zope2.App.test_startup INFO
+  <class 'OFS.Application.Application'>"""
 
 
 def logevent(event):
     logger = logging.getLogger('Zope2.App.test_startup')
     logger.info(event.__class__)
+    db = event.database
+    logger.info(db.__class__)
+    conn = db.open()
+    try:
+        try:
+            root = conn.root()
+            app = root['Application']
+            logger.info(app.__class__)
+        except KeyError:
+            logger.info('Root not ready.')
+    finally:
+        conn.close()
 
 
 class StartupTests(ZopeTestCase):



More information about the Zope-Checkins mailing list