[Zope-Checkins]
CVS: Zope/lib/python/Products/PluginIndexes/FieldIndex/tests
- testFieldIndex.py:1.6.68.1.8.1
Casey Duncan
casey at zope.com
Fri Apr 23 10:26:52 EDT 2004
Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/FieldIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv21327/lib/python/Products/PluginIndexes/FieldIndex/tests
Modified Files:
Tag: casey-fix-index-numobjects-branch
testFieldIndex.py
Log Message:
Fix highly inefficient numObjects() method of "Unindex" variants.
Added test coverage for numObjects.
=== Zope/lib/python/Products/PluginIndexes/FieldIndex/tests/testFieldIndex.py 1.6.68.1 => 1.6.68.1.8.1 ===
--- Zope/lib/python/Products/PluginIndexes/FieldIndex/tests/testFieldIndex.py:1.6.68.1 Wed Jan 7 11:28:10 2004
+++ Zope/lib/python/Products/PluginIndexes/FieldIndex/tests/testFieldIndex.py Fri Apr 23 10:26:21 2004
@@ -93,6 +93,7 @@
assert len( self._index ) == 0
assert len( self._index.referencedObjects() ) == 0
+ self.assertEqual(self._index.numObjects(), 0)
assert self._index.getEntryForObject( 1234 ) is None
assert ( self._index.getEntryForObject( 1234, self._marker )
@@ -115,6 +116,7 @@
values = self._values
assert len( self._index ) == len( values )-1 #'abce' is duplicate
+ self.assertEqual(self._index.numObjects(), len(values)-1)
assert len( self._index.referencedObjects() ) == len( values )
assert self._index.getEntryForObject( 1234 ) is None
More information about the Zope-Checkins
mailing list