1
0
mirror of https://github.com/arsenetar/send2trash.git synced 2024-12-03 19:59:02 +00:00

Modification to symlink test case (that will actually fail when it should -- find_mount_point using abspath instead of realpath.)

This commit is contained in:
gbn 2011-03-13 15:35:14 -04:00
parent eeaf4e8ffa
commit b415ac86e3

View File

@ -112,11 +112,16 @@ class TestSymlink(TestExtVol):
# Since is_parent uses realpath(), and our getdev uses is_parent,
# this should work
self.slDir = mktemp(prefix='s2t', dir=op.expanduser('~'))
os.symlink(self.trashTopdir, self.slDir)
os.mkdir(op.join(self.trashTopdir, 'subdir'), 0o700)
self.filePath = op.join(self.trashTopdir, 'subdir', self.fileName)
touch(self.filePath)
os.symlink(op.join(self.trashTopdir, 'subdir'), self.slDir)
def test_trash(self):
s2t(op.join(self.slDir, self.fileName))
self.assertFalse(op.exists(self.filePath))
self.assertTrue(op.exists(op.join(self.trashTopdir, '.Trash-' + str(os.getuid()), 'files', self.fileName)))
def tearDown(self):
os.remove(self.slDir)