예제 #1
0
 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 _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))
예제 #3
0
 def test_empty(self):
     path = ""
     self.assertEqual(explode_path(path), [])
예제 #4
0
 def test_ends_with_sep(self):
     path = "/home/joe/"
     self.assertEqual(explode_path(path), ["/", "home", "joe"])
예제 #5
0
    def test_simple(self):
        path = "/home/joe"
        self.assertEqual(explode_path(path), ["/", "home", "joe"])

        path = "home/joe"
        self.assertEqual(explode_path(path), ["home", "joe"])
예제 #6
0
 def test_empty(self):
     path = ""
     self.assertEqual(explode_path(path), [])
예제 #7
0
 def test_ends_with_sep(self):
     path = "/home/joe/"
     self.assertEqual(explode_path(path), ["/", "home", "joe"])
예제 #8
0
    def test_simple(self):
        path = "/home/joe"
        self.assertEqual(explode_path(path), ["/", "home", "joe"])

        path = "home/joe"
        self.assertEqual(explode_path(path), ["home", "joe"])