Пример #1
0
    def testMultiLevelNestedSymlinks(self):
        # target/first-link -> ../target/second-link -> ../target

        os.mkdir(os.path.join(self.testdir, "target"))
        self.symlink("../target", "target/second-link")
        self.symlink("../target/second-link", "target/first-link")
        self.failIf(is_broken_symlink(self.testdir, self.testdir,
                                      "target/first-link"))
Пример #2
0
    def testMultiLevelNestedAbsoluteSymlinks(self):
        # first-link -> /second-link/final-target
        # second-link -> /target-dir

        os.mkdir(os.path.join(self.testdir, "final-dir"))
        os.mkdir(os.path.join(self.testdir, "final-dir/final-target"))
        self.symlink("/second-link/final-target", "first-link")
        self.symlink("/final-dir", "second-link")
        self.failIf(is_broken_symlink(self.testdir, self.testdir,
                                      "first-link"))
Пример #3
0
 def testSubdirSelfLoopBroken(self):
     self.failUnless(is_broken_symlink(self.testdir, self.testdir,
                                       "dir/selfloop"))
     self.failUnless(is_broken_symlink(self.testdir, self.testdir,
                                       "dir/selfloop1"))
     self.failUnless(is_broken_symlink(self.testdir, self.testdir,
                                       "dir/subdir/selfloop"))
     self.failUnless(is_broken_symlink(self.testdir, self.testdir,
                                       "dir/subdir/selfloop1"))
     self.failUnless(is_broken_symlink(self.testdir, self.testdir,
                                       "dir/subdir/selfloop2"))
     self.failUnless(is_broken_symlink(self.testdir, self.testdir,
                                       "dir/subdir/selfloop3"))
Пример #4
0
 def testTrailingSlashWorks(self):
     self.failIf(is_broken_symlink(self.testdir, self.testdir,
                                   "trailing-slash-works"))
Пример #5
0
 def testAbsoluteWorksToSymlink(self):
     self.failIf(is_broken_symlink(self.testdir, self.testdir,
                                   "absolute-works-to-symlink"))
Пример #6
0
 def testRelativeWorksToSymlink(self):
     self.failIf(is_broken_symlink(self.testdir, self.testdir,
                                   "relative-works-to-symlink"))
Пример #7
0
 def testAbsoluteSelfLoopBroken(self):
     self.failUnless(is_broken_symlink(self.testdir, self.testdir,
                                       "absolute-selfloop"))
Пример #8
0
 def testExpandingSelfLoopBroken(self):
     self.failUnless(is_broken_symlink(self.testdir, self.testdir,
                                       "explode"))
Пример #9
0
 def testSelfLoopBroken(self):
     self.failUnless(is_broken_symlink(self.testdir, self.testdir,
                                       "selfloop"))
Пример #10
0
 def testTrailingSlashBroken(self):
     self.failUnless(is_broken_symlink(self.testdir, self.testdir,
                                       "trailing-slash-broken"))
Пример #11
0
 def testAbsoluteBrokenToSymlink(self):
     self.failUnless(is_broken_symlink(self.testdir, self.testdir,
                                       "absolute-broken-to-symlink"))
Пример #12
0
 def testRelativeBrokenToSymlink(self):
     self.failUnless(is_broken_symlink(self.testdir, self.testdir,
                                       "relative-broken-to-symlink"))