Example #1
0
 def __init__(self, context):
     self.context = context
     try:
         parent = getParent(self.context)
     except TypeError:
         parent = None
     if parent is not None:
         try:
             pp = getPath(parent)
         except TypeError:
             pp = ""
         if not pp.endswith("/"):
             pp += "/"
         self.pp = pp  # parentpath
     else:
         self.pp = ""
     self.pplen = len(self.pp)
Example #2
0
 def testGetPathOfRoot(self):
     from zope.app.traversing.api import getPath
     self.assertEqual(
         getPath(self.root),
         u'/',
         )
Example #3
0
 def testGetPath(self):
     from zope.app.traversing.api import getPath
     self.assertEqual(
         getPath(self.item),
         u'/folder/item'
         )