Skip to content

Commit 52b75b7

Browse files
committed
Write test for walk_files to check if it accepts Path-like and str objects
1 parent f6162fe commit 52b75b7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/unit/utils/test_utils.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from dvc.utils import makedirs
1212
from dvc.utils import to_chunks
1313
from dvc.utils import tmp_fname
14+
from dvc.utils import walk_files
1415
from tests.basic_env import TestDir
1516

1617

@@ -139,3 +140,15 @@ def pattern(path):
139140
tmp_fname(file_path_info),
140141
re.IGNORECASE,
141142
)
143+
144+
145+
def test_walk_files(repo_dir):
146+
path_list = []
147+
for path in walk_files(repo_dir.root_dir):
148+
path_list.append(path)
149+
150+
path_info_list = []
151+
for path_info in walk_files(PathInfo(repo_dir.root_dir)):
152+
path_info_list.append(path_info)
153+
154+
assert path_list == path_info_list

0 commit comments

Comments
 (0)