[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/PathIndex/tests - testPathIndex.py:1.10
seb
seb@jamkit.com
Thu, 28 Nov 2002 08:03:42 -0500
Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/PathIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv29912/lib/python/Products/PluginIndexes/PathIndex/tests
Modified Files:
testPathIndex.py
Log Message:
- fix for #703 merged from 2.6 branch
=== Zope/lib/python/Products/PluginIndexes/PathIndex/tests/testPathIndex.py 1.9 => 1.10 ===
--- Zope/lib/python/Products/PluginIndexes/PathIndex/tests/testPathIndex.py:1.9 Thu Oct 3 09:42:22 2002
+++ Zope/lib/python/Products/PluginIndexes/PathIndex/tests/testPathIndex.py Thu Nov 28 08:03:10 2002
@@ -78,6 +78,38 @@
assert len(self._index._index)==0
assert len(self._index._unindex)==0
+ def testUnIndexError(self):
+ self._populateIndex()
+
+ # this should not raise an error
+ self._index.unindex_object(-1)
+
+ # nor should this
+ self._index._unindex[1] = "/broken/thing"
+ self._index.unindex_object(1)
+
+ def testRoot(self):
+
+ self._populateIndex()
+
+ tests = [
+ ("/",0, range(1,19)),
+ ]
+
+ for comp,level,results in tests:
+ for path in [comp,"/"+comp,"/"+comp+"/"]:
+ res = self._index._apply_index(
+ {"path":{'query':path,"level":level}})
+ lst = list(res[0].keys())
+ self.assertEqual(lst,results)
+
+ for comp,level,results in tests:
+ for path in [comp,"/"+comp,"/"+comp+"/"]:
+ res = self._index._apply_index(
+ {"path":{'query':( (path,level),)}})
+ lst = list(res[0].keys())
+ self.assertEqual(lst,results)
+
def testRoot(self):