示例#1
0
 def test_filePathDeltaSubdir(self):
     """
     L{filePathDelta} can create a simple relative path to a child path.
     """
     self.assertEqual(
         filePathDelta(FilePath("/foo/bar"), FilePath("/foo/bar/baz")),
         ["baz"])
示例#2
0
 def test_filePathDeltaSubdir(self):
     """
     L{filePathDelta} can create a simple relative path to a child path.
     """
     self.assertEqual(filePathDelta(FilePath("/foo/bar"),
                                    FilePath("/foo/bar/baz")),
                      ["baz"])
示例#3
0
 def test_filePathDeltaSiblingDir(self):
     """
     L{filePathDelta} can traverse upwards to create relative paths to
     siblings.
     """
     self.assertEqual(
         filePathDelta(FilePath("/foo/bar"), FilePath("/foo/baz")),
         ["..", "baz"])
示例#4
0
 def test_filePathDeltaSimilarEndElements(self):
     """
     L{filePathDelta} doesn't take into account final elements when
     comparing 2 paths, but stops at the first difference.
     """
     self.assertEqual(filePathDelta(FilePath("/foo/bar/bar/spam"),
                                    FilePath("/foo/bar/baz/spam")),
                      ["..", "..", "baz", "spam"])
示例#5
0
 def test_filePathNoCommonElements(self):
     """
     L{filePathDelta} can create relative paths to totally unrelated paths
     for maximum portability.
     """
     self.assertEqual(filePathDelta(FilePath("/foo/bar"),
                                    FilePath("/baz/quux")),
                      ["..", "..", "baz", "quux"])
示例#6
0
 def test_filePathDeltaSiblingDir(self):
     """
     L{filePathDelta} can traverse upwards to create relative paths to
     siblings.
     """
     self.assertEqual(filePathDelta(FilePath("/foo/bar"),
                                    FilePath("/foo/baz")),
                      ["..", "baz"])