Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restyle Write test for walk_files to check if it accepts Path-like and str objects #3036

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tests/unit/utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from dvc.utils import makedirs
from dvc.utils import to_chunks
from dvc.utils import tmp_fname
from dvc.utils import walk_files
from tests.basic_env import TestDir


Expand Down Expand Up @@ -139,3 +140,15 @@ def pattern(path):
tmp_fname(file_path_info),
re.IGNORECASE,
)


def test_walk_files(repo_dir):
path_list = []
for path in walk_files(repo_dir.root_dir):
path_list.append(path)

path_info_list = []
for path_info in walk_files(PathInfo(repo_dir.root_dir)):
path_info_list.append(path_info)

assert path_list == path_info_list