[Zope-Checkins] CVS: Zope2 - testUnKeywordIndex.py:1.4
Jim Fulton
jim@digicool.com
Wed, 28 Mar 2001 17:34:15 -0500 (EST)
Update of /cvs-repository/Zope2/lib/python/SearchIndex/tests
In directory korak:/tmp/cvs-serv1469
Modified Files:
testUnKeywordIndex.py
Log Message:
Added unit test to test for bug in indexing objects with no keywords,
which generated spurious log entry about unindexing a non-existent
object.
--- Updated File testUnKeywordIndex.py in package Zope2 --
--- testUnKeywordIndex.py 2001/03/20 13:49:36 1.3
+++ testUnKeywordIndex.py 2001/03/28 22:34:14 1.4
@@ -139,7 +139,7 @@
def _populateIndex( self ):
for k, v in self._values:
self._index.index_object( k, v )
-
+
def _checkApply( self, req, expectedValues ):
result, used = self._index._apply_index( req )
assert used == ( 'foo', )
@@ -150,6 +150,24 @@
if hasattr(result, 'keys'): result=result.keys()
for k, v in expectedValues:
assert k in result
+
+ def testAddObjectWOKeywords(self):
+
+
+ import zLOG
+
+ def log_write(subsystem, severity, summary, detail, error,
+ PROBLEM=zLOG.PROBLEM):
+ if severity >= PROBLEM:
+ assert 0, "%s(%s): %s" % (subsystem, severity, summary)
+
+ old_log_write=zLOG.log_write
+ zLOG.log_write=log_write
+ try:
+ self._populateIndex()
+ self._index.index_object(999, None)
+ finally:
+ zLOG.log_write=old_log_write
def testEmpty( self ):
assert len( self._index ) == 0