def _prefix_destdir(path): destdir = subst_vars("$destdir", variables) if path: tail = explode_path(path)[1:] if not tail: raise ValueError("Invalid target directory in section %r " "(not absolute: %r)" % (name, path)) return os.path.join(destdir, os.path.join(*tail)) else: raise ValueError("Invalid target directory in section " "%r: %r" % (name, path))
def test_empty(self): path = "" self.assertEqual(explode_path(path), [])
def test_ends_with_sep(self): path = "/home/joe/" self.assertEqual(explode_path(path), ["/", "home", "joe"])
def test_simple(self): path = "/home/joe" self.assertEqual(explode_path(path), ["/", "home", "joe"]) path = "home/joe" self.assertEqual(explode_path(path), ["home", "joe"])