[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/StartUp/tests - testStartupDirectives.py:1.4
Guido van Rossum
guido@python.org
Thu, 19 Dec 2002 18:05:23 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/StartUp/tests
In directory cvs.zope.org:/tmp/cvs-serv16444/tests
Modified Files:
testStartupDirectives.py
Log Message:
Convert to logging module.
=== Zope3/lib/python/Zope/App/StartUp/tests/testStartupDirectives.py 1.3 => 1.4 ===
--- Zope3/lib/python/Zope/App/StartUp/tests/testStartupDirectives.py:1.3 Thu Dec 12 13:35:27 2002
+++ Zope3/lib/python/Zope/App/StartUp/tests/testStartupDirectives.py Thu Dec 19 18:05:22 2002
@@ -17,6 +17,8 @@
"""
import unittest, sys, tempfile, os
+import logging
+
from Zope.App.OFS.Services.ServiceManager.tests.PlacefulSetup import \
PlacefulSetup
from Zope.App.StartUp.metaConfigure import SiteDefinition
@@ -62,14 +64,21 @@
def testUseLog(self):
sd = self._createBlankSiteDefinition()
- from zLOG.MinimalLogger import _log_dest
-
self.assertEqual(sd.useLog(ContextStub()), [])
- self.assertEqual(_log_dest, sys.stderr)
+ for h in logging.root.handlers:
+ if isinstance(h, logging.StreamHandler):
+ if h.stream is sys.stderr:
+ break
+ else:
+ self.fail("Not logging to sys.stderr")
self.assertEqual(sd.useLog(ContextStub(), _fsname), [])
- from zLOG.MinimalLogger import _log_dest
- self.assertEqual(_log_dest.name, open(_fsname, 'w').name)
+ for h in logging.root.handlers:
+ if isinstance(h, logging.FileHandler):
+ if h.baseFilename == _fsname:
+ break
+ else:
+ self.fail("Not logging to _fsname")
def testAddServer(self):