Simulates the go module tree. See #1042
(tmpdir)
| 98 | |
| 99 | |
| 100 | def test_rmtree_read_only_directories(tmpdir): |
| 101 | """Simulates the go module tree. See #1042""" |
| 102 | tmpdir.join('x/y/z').ensure_dir().join('a').ensure() |
| 103 | mode = os.stat(str(tmpdir.join('x'))).st_mode |
| 104 | mode_no_w = mode & ~(stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH) |
| 105 | tmpdir.join('x/y/z').chmod(mode_no_w) |
| 106 | tmpdir.join('x/y/z').chmod(mode_no_w) |
| 107 | tmpdir.join('x/y/z').chmod(mode_no_w) |
| 108 | rmtree(str(tmpdir.join('x'))) |