Commit abdc7232 authored by Andreas Jung's avatar Andreas Jung

The fix for Collector #583 has been lost for unknown reasons

parent da8f819a
......@@ -11,7 +11,7 @@
#
##############################################################################
__version__ = '$Id: PathIndex.py,v 1.27 2002/10/03 13:10:49 andreasjung Exp $'
__version__ = '$Id: PathIndex.py,v 1.28 2002/10/03 13:42:22 andreasjung Exp $'
from Products.PluginIndexes import PluggableIndex
from Products.PluginIndexes.common.util import parseIndexRequest
......@@ -202,6 +202,9 @@ class PathIndex(Persistent, Implicit, SimpleItem):
comps = self.splitPath(path)
if len(comps) == 0:
return IISet(self._unindex.keys())
if level >=0:
results = []
......
......@@ -79,6 +79,29 @@ class TestCase( unittest.TestCase ):
assert len(self._index._unindex)==0
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 testSimpleTests(self):
self._populateIndex()
......@@ -98,7 +121,6 @@ class TestCase( unittest.TestCase ):
("18.html", -1, [18] ),
("cc/18.html", -1, [18] ),
("cc/18.html", 2, [18] ),
]
for comp,level,results in tests:
......
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