island: use constants for permissions mode in test_file_utils.py

This commit is contained in:
Mike Salvatore 2021-06-15 09:31:22 -04:00
parent 8b2c3ef8a3
commit 6b4a0906c0
1 changed files with 5 additions and 1 deletions

View File

@ -70,7 +70,11 @@ def test_create_secure_directory__no_parent_dir(test_path_nested):
def test_create_secure_directory__perm_linux(test_path): def test_create_secure_directory__perm_linux(test_path):
create_secure_directory(test_path) create_secure_directory(test_path)
st = os.stat(test_path) st = os.stat(test_path)
assert (st.st_mode & 0o777) == stat.S_IRWXU
expected_mode = stat.S_IRWXU
actual_mode = st.st_mode & (stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)
assert expected_mode == actual_mode
@pytest.mark.skipif(not is_windows_os(), reason="Tests Windows (not Posix) permissions.") @pytest.mark.skipif(not is_windows_os(), reason="Tests Windows (not Posix) permissions.")