Skip to content

Commit

Permalink
remove .DS_Store and add .file
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouzaida committed Jun 29, 2021
1 parent 4eab1b2 commit 39913ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Empty file added tests/data/for_scan/.file
Empty file.
14 changes: 6 additions & 8 deletions tests/test_utils/test_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,13 @@ def test_scandir():

filenames_recursive = [
'a.bin', '1.txt', '2.txt', '1.json', '2.json', 'sub/1.json',
'sub/1.txt', '.DS_Store'
'sub/1.txt', '.file'
]
# .DS_Store starts with '.' and is a file so it will not be scanned
assert set(mmcv.scandir(folder, recursive=True)) == set([
filename for filename in filenames_recursive if filename != '.DS_Store'
])
assert set(mmcv.scandir(Path(folder), recursive=True)) == set([
filename for filename in filenames_recursive if filename != '.DS_Store'
])
# .file starts with '.' and is a file so it will not be scanned
assert set(mmcv.scandir(folder, recursive=True)) == set(
[filename for filename in filenames_recursive if filename != '.file'])
assert set(mmcv.scandir(Path(folder), recursive=True)) == set(
[filename for filename in filenames_recursive if filename != '.file'])
assert set(mmcv.scandir(folder, '.txt', recursive=True)) == set([
filename for filename in filenames_recursive
if filename.endswith('.txt')
Expand Down

0 comments on commit 39913ba

Please sign in to comment.