Skip to content

Commit

Permalink
Skip permission tests on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
roll committed Sep 25, 2024
1 parent e756346 commit b516290
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dplib/helpers/__spec__/test_file.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
import os
import platform
import stat
from pathlib import Path

import pytest

from dplib.helpers.file import write_file


@pytest.mark.skipif(platform.system() == "Windows", reason="Unix only")
def test_write_file_implicit_permissions_dp_002(tmpdir: Path):
path = str(tmpdir / "test.txt")
write_file(path, "Hello, World!")
permissions = oct(stat.S_IMODE(os.stat(path).st_mode))
assert permissions == "0o600"


@pytest.mark.skipif(platform.system() == "Windows", reason="Unix only")
def test_write_file_explicit_permissions_dp_003(tmpdir: Path):
path = str(tmpdir / "test.txt")
write_file(path, "Hello, World!", permissions=0o644)
Expand Down

0 comments on commit b516290

Please sign in to comment.