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"))
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"))
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"))
def testTrailingSlashWorks(self): self.failIf(is_broken_symlink(self.testdir, self.testdir, "trailing-slash-works"))
def testAbsoluteWorksToSymlink(self): self.failIf(is_broken_symlink(self.testdir, self.testdir, "absolute-works-to-symlink"))
def testRelativeWorksToSymlink(self): self.failIf(is_broken_symlink(self.testdir, self.testdir, "relative-works-to-symlink"))
def testAbsoluteSelfLoopBroken(self): self.failUnless(is_broken_symlink(self.testdir, self.testdir, "absolute-selfloop"))
def testExpandingSelfLoopBroken(self): self.failUnless(is_broken_symlink(self.testdir, self.testdir, "explode"))
def testSelfLoopBroken(self): self.failUnless(is_broken_symlink(self.testdir, self.testdir, "selfloop"))
def testTrailingSlashBroken(self): self.failUnless(is_broken_symlink(self.testdir, self.testdir, "trailing-slash-broken"))
def testAbsoluteBrokenToSymlink(self): self.failUnless(is_broken_symlink(self.testdir, self.testdir, "absolute-broken-to-symlink"))
def testRelativeBrokenToSymlink(self): self.failUnless(is_broken_symlink(self.testdir, self.testdir, "relative-broken-to-symlink"))