def test_ClobberFile(self): linkName = os.path.join(self.tempdir, 'link') with open(linkName, 'w') as f: f.write('foo') symlink.Force(self.source.name, linkName) self.verifySymlink(linkName)
def test_NoClobberDir(self): linkName = os.path.join(self.tempdir, 'link') os.mkdir(linkName, 0777) try: symlink.Force(self.source.name, linkName) except symlink.LinkError: pass
def test_ClobberSymlink(self): linkName = os.path.join(self.tempdir, 'link') os.symlink('nowhere', linkName) symlink.Force(self.source.name, linkName) self.verifySymlink(linkName)