def test_check_when_is_symlink(self): # prepare import subprocess topdir = Path("sandbox").join("trash-dir") topdir.mkdir() assert subprocess.call(["chmod", "+t", topdir.path]) == 0 topdir_link = Path("sandbox/trash-dir-link") topdir_link.write_link("./trash-dir") volume = Volume(Path("/mnt/disk"), True) instance = Method1VolumeTrashDirectory(topdir_link.join("123"), volume) instance.check()