(self, chmod_func, target, link, **kwargs)
| 1108 | self.check_chmod(posix.chmod, target, follow_symlinks=False) |
| 1109 | |
| 1110 | def check_chmod_link(self, chmod_func, target, link, **kwargs): |
| 1111 | target_mode = os.stat(target).st_mode |
| 1112 | link_mode = os.lstat(link).st_mode |
| 1113 | try: |
| 1114 | new_mode = target_mode & ~(stat.S_IWOTH | stat.S_IWGRP | stat.S_IWUSR) |
| 1115 | chmod_func(link, new_mode, **kwargs) |
| 1116 | self.assertEqual(os.stat(target).st_mode, new_mode) |
| 1117 | self.assertEqual(os.lstat(link).st_mode, link_mode) |
| 1118 | new_mode = target_mode | (stat.S_IWOTH | stat.S_IWGRP | stat.S_IWUSR) |
| 1119 | chmod_func(link, new_mode, **kwargs) |
| 1120 | self.assertEqual(os.stat(target).st_mode, new_mode) |
| 1121 | self.assertEqual(os.lstat(link).st_mode, link_mode) |
| 1122 | finally: |
| 1123 | posix.chmod(target, target_mode) |
| 1124 | |
| 1125 | def check_lchmod_link(self, chmod_func, target, link, **kwargs): |
| 1126 | target_mode = os.stat(target).st_mode |
no test coverage detected