File tree 1 file changed +18
-1
lines changed
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 1
- from boltons .fileutils import FilePerms
1
+ import os .path
2
+
3
+ from boltons import fileutils
4
+ from boltons .fileutils import FilePerms , iter_find_files
5
+
6
+
7
+ BOLTONS_PATH = os .path .dirname (os .path .abspath (fileutils .__file__ ))
2
8
3
9
4
10
def test_fileperms ():
@@ -17,3 +23,14 @@ def test_fileperms():
17
23
assert oct (int (up )) == '0o770'
18
24
19
25
assert int (FilePerms ()) == 0
26
+
27
+
28
+ def test_iter_find_files ():
29
+ def _to_baseless_list (paths ):
30
+ return [p .lstrip (BOLTONS_PATH ) for p in paths ]
31
+
32
+ assert 'fileutils.py' in _to_baseless_list (iter_find_files (BOLTONS_PATH , patterns = ['*.py' ]))
33
+
34
+ boltons_parent = os .path .dirname (BOLTONS_PATH )
35
+ assert 'fileutils.py' in _to_baseless_list (iter_find_files (boltons_parent , patterns = ['*.py' ]))
36
+ assert 'fileutils.py' not in _to_baseless_list (iter_find_files (boltons_parent , patterns = ['*.py' ], max_depth = 0 ))
You can’t perform that action at this time.
0 commit comments