Files
dvc/tests/func/utils/test_fs.py
T
Saugat Pachhai (सौगात) 75fa487406 dvc: remove unused utils and redundant tests
The tests should be in dvc-objects repo npw, and will be migrated soon.
The nanotime and diskcache are specified in dvc-objects, so we don't need
those here.
2022-05-20 19:17:00 +05:45

21 lines
549 B
Python

import os
import stat
import pytest
from dvc.utils.fs import makedirs
@pytest.mark.skipif(os.name == "nt", reason="Not supported for Windows.")
def test_makedirs_permissions(tmp_dir):
dir_mode = 0o755
intermediate_dir = "тестовая-директория"
test_dir = os.path.join(intermediate_dir, "data")
assert not os.path.exists(intermediate_dir)
makedirs(test_dir, mode=dir_mode)
assert stat.S_IMODE(os.stat(test_dir).st_mode) == dir_mode
assert stat.S_IMODE(os.stat(intermediate_dir).st_mode) == dir_mode