[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/PathIndex/tests - testPathIndex.py:1.6
Andreas Jung
andreas@digicool.com
Tue, 11 Jun 2002 17:05:28 -0400
Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/PathIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv9868/PathIndex/tests
Modified Files:
testPathIndex.py
Log Message:
- removed empty or meaningless comments
- minor source code cleanup
=== Zope/lib/python/Products/PluginIndexes/PathIndex/tests/testPathIndex.py 1.5 => 1.6 ===
class TestCase( unittest.TestCase ):
- """
- Test PathIndex objects.
- """
-
- def setUp( self ):
- """
- """
+ """ Test PathIndex objects """
+
+ def setUp(self):
self._index = PathIndex( 'path' )
self._values = {
1 : Dummy("/aa/aa/aa/1.html"),
@@ -61,27 +57,18 @@
18 : Dummy("/bb/cc/cc/18html")
}
-
- def tearDown( self ):
- """
- """
-
- def _populateIndex( self ):
+ def _populateIndex(self):
for k, v in self._values.items():
self._index.index_object( k, v )
-
- def testEmpty( self ):
- "Test an empty PathIndex."
+ def testEmpty(self):
assert len( self._index ) == 0
assert self._index.getEntryForObject( 1234 ) is None
self._index.unindex_object( 1234 ) # nothrow
assert self._index._apply_index( {"suxpath":"xxx"} ) is None
-
- def testUnIndex( self ):
- "Test to UnIndex PathIndex."
+ def testUnIndex(self):
self._populateIndex()
@@ -92,7 +79,7 @@
assert len(self._index._unindex)==0
- def testSimpleTests( self ):
+ def testSimpleTests(self):
self._populateIndex()
@@ -123,8 +110,7 @@
lst = list(res[0].keys())
self.assertEqual(lst,results)
-
- def testComplexOrTests( self ):
+ def testComplexOrTests(self):
self._populateIndex()
@@ -141,7 +127,7 @@
lst = list(res[0].keys())
self.assertEqual(lst,results)
- def testComplexANDTests( self ):
+ def testComplexANDTests(self):
self._populateIndex()
@@ -157,7 +143,6 @@
{"path":{'query':lst,"level":level,"operator":"and"}})
lst = list(res[0].keys())
self.assertEqual(lst,results)
-
def test_suite():
return unittest.makeSuite( TestCase )