(tmp_path: Path)
| 589 | |
| 590 | |
| 591 | def test_lock_mode_soft(tmp_path: Path) -> None: |
| 592 | # test soft lock permissions are dependent of umask |
| 593 | lock_path = tmp_path / "a.lock" |
| 594 | lock = SoftFileLock(str(lock_path), mode=0o666) |
| 595 | |
| 596 | # set umask so permissions can be anticipated |
| 597 | initial_umask = os.umask(0o022) |
| 598 | try: |
| 599 | lock.acquire() |
| 600 | assert lock.is_locked |
| 601 | |
| 602 | mode = filemode(lock_path.stat().st_mode) |
| 603 | if sys.platform == "win32": |
| 604 | assert mode == "-rw-rw-rw-" |
| 605 | else: |
| 606 | assert mode == "-rw-r--r--" |
| 607 | finally: |
| 608 | os.umask(initial_umask) |
| 609 | |
| 610 | lock.release() |
| 611 | |
| 612 | |
| 613 | def test_umask(tmp_path: Path) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…