[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TextIndex/tests - testSplitter.py:1.5 testTextIndex.py:1.4 framework.py:NONE
Tres Seaver
tseaver@zope.com
Wed, 17 Oct 2001 16:01:04 -0400
Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TextIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv30119/lib/python/Products/PluginIndexes/TextIndex/tests
Modified Files:
testSplitter.py testTextIndex.py
Removed Files:
framework.py
Log Message:
o Land unit test cleanup from branch.
o Known breakage as of 2001/10/17:
- TAL test suite is very broken (TAL is currently suppressed in
lib/python/.testinfo).
- AccessControl tests don't run if run first; lib/python/.testinfo
pushes them to the end of the queue, at which point they *do* run.
Global side effects suck!
- lib/python/BTrees/testBTreesUnicode.py: weird flakiness around
comparison of ASCII and Unicode strings; breaks in different
ways under Python 2.1 and 2.2.
- lib/python/Products/PageTemplates/tests: three tests break due
to security asserctions.
=== Zope/lib/python/Products/PluginIndexes/TextIndex/tests/testSplitter.py 1.4 => 1.5 ===
import os,sys
-execfile(os.path.join(sys.path[0],'framework.py'))
import unittest,locale
from Products.PluginIndexes.TextIndex import Splitter
=== Zope/lib/python/Products/PluginIndexes/TextIndex/tests/testTextIndex.py 1.3 => 1.4 ===
##############################################################################
-import sys, os
-execfile(os.path.join(sys.path[0],'framework.py'))
+import sys, os, unittest
import zLOG
def log_write(subsystem, severity, summary, detail, error):
if severity >= zLOG.PROBLEM:
assert 0, "%s(%s): %s" % (subsystem, severity, summary)
-zLOG.log_write=log_write
import ZODB, ZODB.DemoStorage, ZODB.FileStorage
-import TextIndex
-import GlobbingLexicon
+from Products.PluginIndexes.TextIndex import TextIndex
+from Products.PluginIndexes.TextIndex import GlobbingLexicon
+
+class Dummy:
+
+ def __init__( self, text ):
+ self._text = text
+
+ def text( self ):
+ return self._text
+
+ def __str__( self ):
+ return '<Dummy: %s>' % self._text
+
+ __repr__ = __str__
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):
n = 'fs_tmp__%s' % os.getpid()
@@ -124,6 +138,7 @@
if hasattr(self, 'jar'):
self.dbclose()
os.system('rm -f fs_tmp__*')
+ zLOG.log_write=self.old_log_write
def checkSimpleAddDelete(self):
"Check that we can add and delete an object without error"
=== Removed File Zope/lib/python/Products/PluginIndexes/TextIndex/tests/framework.py ===