def testAbsSymlink(self): fname = 'dir/file2.txt' symlink = 'localconfig.py' self._createRegularFile(fname) os.symlink(path.join(self.tempdir, fname), path.join(self.tempdir, symlink)) self.assertEqual(fname, getRealpath(symlink, cwd=self.tempdir))
def testRelativeSymlinkToRelativeSymlink(self): fname = 'dir/file7.txt' symlink1 = 'production.py' symlink2 = 'localconfig.py' self._createRegularFile(fname) os.symlink(fname, path.join(self.tempdir, symlink1)) os.symlink(symlink1, path.join(self.tempdir, symlink2)) self.assertEqual(fname, getRealpath(symlink2, cwd=self.tempdir))
def testDepth(self): fname = 'dir1/dir2/dir3/file9.txt' symlink1 = 'production.py' symlink2 = 'localconfig.py' self._createRegularFile(fname) os.symlink(fname, path.join(self.tempdir, symlink1)) os.symlink(symlink1, path.join(self.tempdir, symlink2)) self.assertEqual(fname, getRealpath(symlink2, cwd=self.tempdir, depth=3))
def test3Levels(self): fname = 'dir/file8.txt' symlink1 = 'symlink1' symlink2 = 'symlink2' symlink3 = 'symlink3' self._createRegularFile(fname) os.symlink(fname, path.join(self.tempdir, symlink1)) os.symlink(symlink1, path.join(self.tempdir, symlink2)) os.symlink(symlink2, path.join(self.tempdir, symlink3)) self.assertEqual(fname, getRealpath(symlink3, cwd=self.tempdir))
def testRegularFile(self): fname = 'dir/file1.txt' self._createRegularFile(fname) self.assertEqual(fname, getRealpath(fname))