Commit 6f07ae8a authored by Andreas Jung's avatar Andreas Jung

getting rid of the zLOG module including some zLOG culprits

in some unittests (if necessary we need to restablish the hacks
in a saner way)
parent a2cd4262
......@@ -20,8 +20,6 @@ import Testing
import Zope2
Zope2.startup()
import zLOG
from Products.PluginIndexes.KeywordIndex.KeywordIndex import KeywordIndex
......@@ -78,27 +76,6 @@ class TestKeywordIndex( unittest.TestCase ):
"""
"""
def _catch_log_errors( self ):
if self._old_log_write is not None:
return
def log_write(subsystem, severity, summary, detail, error,
PROBLEM=zLOG.PROBLEM):
if severity > PROBLEM:
assert 0, "%s(%s): %s" % (subsystem, severity, summary)
self._old_log_write = zLOG.log_write
zLOG.log_write = log_write
def _ignore_log_errors( self ):
if self._old_log_write is None:
return
zLOG.log_write = self._old_log_write
del self._old_log_write
def _populateIndex( self ):
for k, v in self._values:
self._index.index_object( k, v )
......@@ -126,12 +103,11 @@ class TestKeywordIndex( unittest.TestCase ):
def testAddObjectWOKeywords(self):
self._catch_log_errors()
try:
self._populateIndex()
self._index.index_object(999, None)
finally:
self._ignore_log_errors()
pass
def testEmpty( self ):
assert len( self._index ) == 0
......@@ -236,12 +212,11 @@ class TestKeywordIndex( unittest.TestCase ):
self._checkApply( record, self._values[6:7] )
def testDuplicateKeywords(self):
self._catch_log_errors()
try:
self._index.index_object(0, Dummy(['a', 'a', 'b', 'b']))
self._index.unindex_object(0)
finally:
self._ignore_log_errors()
pass
def testCollectorIssue889(self) :
# Test that collector issue 889 is solved
......
......@@ -20,12 +20,6 @@ import Testing
import Zope2
Zope2.startup()
import zLOG
def log_write(subsystem, severity, summary, detail, error):
if severity >= zLOG.PROBLEM:
assert 0, "%s(%s): %s" % (subsystem, severity, summary)
import ZODB
from ZODB.MappingStorage import MappingStorage
import transaction
......@@ -56,8 +50,6 @@ class Tests(unittest.TestCase):
def setUp(self):
self.index=TextIndex.TextIndex('text')
self.doc=Dummy(text='this is the time, when all good zopes')
self.old_log_write = zLOG.log_write
zLOG.log_write=log_write
def dbopen(self):
if self.db is None:
......@@ -84,7 +76,6 @@ class Tests(unittest.TestCase):
if self.db is not None:
self.db.close()
self.db = None
zLOG.log_write=self.old_log_write
def test_z3interfaces(self):
from Products.PluginIndexes.interfaces import IPluggableIndex
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment