Commit 8844458f authored by Jim Fulton's avatar Jim Fulton

Added unit test to test for bug in indexing objects with no keywords,

which generated spurious log entry about unindexing a non-existent
object.
parent 0b900229
......@@ -151,6 +151,24 @@ class TestCase( unittest.TestCase ):
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
assert len( self._index.referencedObjects() ) == 0
......
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