[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/PathIndex/tests - testPathIndex.py:1.7.6.1

Andreas Jung andreas@digicool.com
Mon, 23 Sep 2002 12:50:08 -0400


Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/PathIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv6542/lib/python/Products/PluginIndexes/PathIndex/tests

Modified Files:
      Tag: Zope-2_6-branch
	testPathIndex.py 
Log Message:
Collector #583: backport from trunk

=== Zope/lib/python/Products/PluginIndexes/PathIndex/tests/testPathIndex.py 1.7 => 1.7.6.1 ===
--- Zope/lib/python/Products/PluginIndexes/PathIndex/tests/testPathIndex.py:1.7	Wed Aug 14 18:19:31 2002
+++ Zope/lib/python/Products/PluginIndexes/PathIndex/tests/testPathIndex.py	Mon Sep 23 12:50:08 2002
@@ -79,6 +79,29 @@
         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()