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)
def testGetPathOfRoot(self): from zope.app.traversing.api import getPath self.assertEqual( getPath(self.root), u'/', )
def testGetPath(self): from zope.app.traversing.api import getPath self.assertEqual( getPath(self.item), u'/folder/item' )