diff options
Diffstat (limited to 'Lib/test/test_posixpath.py')
-rw-r--r-- | Lib/test/test_posixpath.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py index 2288c48f47..8bb78d66e2 100644 --- a/Lib/test/test_posixpath.py +++ b/Lib/test/test_posixpath.py @@ -322,6 +322,15 @@ class PosixPathTest(unittest.TestCase): self.assertEqual(posixpath.relpath("a/b", "../c"), "../"+curdir+"/a/b") self.assertEqual(posixpath.relpath("a", "b/c"), "../../a") self.assertEqual(posixpath.relpath("a", "a"), ".") + self.assertEqual(posixpath.relpath("/foo/bar/bat", "/x/y/z"), '../../../foo/bar/bat') + self.assertEqual(posixpath.relpath("/foo/bar/bat", "/foo/bar"), 'bat') + self.assertEqual(posixpath.relpath("/foo/bar/bat", "/"), 'foo/bar/bat') + self.assertEqual(posixpath.relpath("/", "/foo/bar/bat"), '../../..') + self.assertEqual(posixpath.relpath("/foo/bar/bat", "/x"), '../foo/bar/bat') + self.assertEqual(posixpath.relpath("/x", "/foo/bar/bat"), '../../../x') + self.assertEqual(posixpath.relpath("/", "/"), '.') + self.assertEqual(posixpath.relpath("/a", "/a"), '.') + self.assertEqual(posixpath.relpath("/a/b", "/a/b"), '.') finally: os.getcwd = real_getcwd |