Skip to content

Commit

Permalink
Don't test group/other perms on windows (not supported)
Browse files Browse the repository at this point in the history
  • Loading branch information
brainsik committed Aug 13, 2024
1 parent 5013088 commit d6ea3f9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_json_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import absolute_import, unicode_literals

import os
import platform
import shutil
import stat
from tempfile import NamedTemporaryFile
Expand Down Expand Up @@ -154,10 +155,11 @@ def test_set_mode():
store = get_new_store(mode=int("640", 8))
try:
st_mode = os.stat(store.path).st_mode
is_windows = platform.system() == "Windows"
assert st_mode & stat.S_IRUSR
assert st_mode & stat.S_IWUSR
assert st_mode & stat.S_IRGRP
assert not st_mode & stat.S_IWGRP
assert not st_mode & stat.S_IROTH
assert st_mode & stat.S_IRGRP or is_windows
assert not st_mode & stat.S_IWGRP or is_windows
assert not st_mode & stat.S_IROTH or is_windows
finally:
os.remove(store.path)

0 comments on commit d6ea3f9

Please sign in to comment.