[Zope-Checkins] CVS: Zope/lib/python/Zope/Startup/tests - testStarter.py:1.16

Fred L. Drake, Jr. fred at zope.com
Tue Apr 13 16:57:09 EDT 2004


Update of /cvs-repository/Zope/lib/python/Zope/Startup/tests
In directory cvs.zope.org:/tmp/cvs-serv24038/lib/python/Zope/Startup/tests

Modified Files:
	testStarter.py 
Log Message:
clean up a little: only do the startup log handler dance when we need to;
the signal handler installation is abstracted in the same way


=== Zope/lib/python/Zope/Startup/tests/testStarter.py 1.15 => 1.16 ===
--- Zope/lib/python/Zope/Startup/tests/testStarter.py:1.15	Tue Apr 13 13:56:55 2004
+++ Zope/lib/python/Zope/Startup/tests/testStarter.py	Tue Apr 13 16:57:08 2004
@@ -23,7 +23,7 @@
 import ZConfig
 import Zope.Startup
 from Zope.Startup import handlers
-from Zope.Startup import ZopeStarter
+from Zope.Startup import ZopeStarter, UnixZopeStarter
 
 from App.config import getConfiguration, setConfiguration
 
@@ -118,8 +118,8 @@
               level blather
              </logfile>
            </eventlog>""")
-        starter = ZopeStarter(conf)
-        starter.setupStartupHandler()
+        starter = UnixZopeStarter(conf)
+        starter.setupInitialLogging()
 
         # startup handler should take on the level of the event log handler
         # with the lowest level
@@ -139,8 +139,8 @@
               level info
              </logfile>
            </eventlog>""")
-        starter = ZopeStarter(conf)
-        starter.setupStartupHandler()
+        starter = UnixZopeStarter(conf)
+        starter.setupInitialLogging()
         self.failIfEqual(starter.startup_handler.stream, sys.stderr)
 
     def testSetupZServerThreads(self):
@@ -267,14 +267,12 @@
            </logger>
            """)
         try:
-            starter = ZopeStarter(conf)
-            starter.setupStartupHandler()
+            starter = UnixZopeStarter(conf)
+            starter.setupInitialLogging()
             starter.info('hello')
-            starter.removeStartupHandler()
-            starter.setupConfiguredLoggers()
+            starter.setupFinalLogging()
             logger = logging.getLogger()
             self.assertEqual(logger.level, logging.INFO)
-            starter.flushStartupHandlerBuffer()
             l = open(os.path.join(TEMPNAME, 'event.log')).read()
             self.failUnless(l.find('hello') > -1)
             self.failUnless(os.path.exists(os.path.join(TEMPNAME, 'Z2.log')))




More information about the Zope-Checkins mailing list