mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-09 23:10:24 +01:00
Ensure makedirs accepts str and Path-like objects
This commit is contained in:
+1
-1
@@ -224,7 +224,7 @@ class RemoteLOCAL(RemoteBASE):
|
||||
def _upload(
|
||||
self, from_file, to_info, name=None, no_progress_bar=False, **_kwargs
|
||||
):
|
||||
makedirs(fspath_py35(to_info.parent), exist_ok=True)
|
||||
makedirs(to_info.parent, exist_ok=True)
|
||||
|
||||
tmp_file = tmp_fname(to_info)
|
||||
copyfile(
|
||||
|
||||
@@ -7,6 +7,7 @@ from dvc.path_info import PathInfo
|
||||
from dvc.utils import copyfile
|
||||
from dvc.utils import file_md5
|
||||
from dvc.utils import fix_env
|
||||
from dvc.utils import makedirs
|
||||
from dvc.utils import to_chunks
|
||||
from tests.basic_env import TestDir
|
||||
|
||||
@@ -108,3 +109,16 @@ def test_copyfile(path, repo_dir):
|
||||
)
|
||||
else:
|
||||
assert filecmp.cmp(src_info.fspath, dest_info.fspath, shallow=False)
|
||||
|
||||
|
||||
def test_makedirs(repo_dir):
|
||||
path = os.path.join(repo_dir.root_dir, "directory")
|
||||
path_info = PathInfo(
|
||||
os.path.join(repo_dir.root_dir, "another", "directory")
|
||||
)
|
||||
|
||||
makedirs(path)
|
||||
assert os.path.isdir(path)
|
||||
|
||||
makedirs(path_info)
|
||||
assert os.path.isdir(path_info.fspath)
|
||||
|
||||
Reference in New Issue
Block a user