File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 8
8
from boltons .fileutils import FilePerms , iter_find_files
9
9
10
10
11
+ # Directory of boltons source files (not ending with '/').
11
12
BOLTONS_PATH = os .path .dirname (os .path .abspath (fileutils .__file__ ))
12
13
13
14
@@ -31,13 +32,13 @@ def test_fileperms():
31
32
32
33
def test_iter_find_files ():
33
34
def _to_baseless_list (paths ):
34
- return [p .lstrip (BOLTONS_PATH ) for p in paths ]
35
+ return [p .removeprefix (BOLTONS_PATH ) for p in paths ]
35
36
36
- assert 'fileutils.py' in _to_baseless_list (iter_find_files (BOLTONS_PATH , patterns = ['*.py' ]))
37
+ assert '/ fileutils.py' in _to_baseless_list (iter_find_files (BOLTONS_PATH , patterns = ['*.py' ]))
37
38
38
39
boltons_parent = os .path .dirname (BOLTONS_PATH )
39
- assert 'fileutils.py' in _to_baseless_list (iter_find_files (boltons_parent , patterns = ['*.py' ]))
40
- assert 'fileutils.py' not in _to_baseless_list (iter_find_files (boltons_parent , patterns = ['*.py' ], max_depth = 0 ))
40
+ assert '/ fileutils.py' in _to_baseless_list (iter_find_files (boltons_parent , patterns = ['*.py' ]))
41
+ assert '/ fileutils.py' not in _to_baseless_list (iter_find_files (boltons_parent , patterns = ['*.py' ], max_depth = 0 ))
41
42
42
43
43
44
def test_rotate_file_no_rotation (tmp_path ):
You can’t perform that action at this time.
0 commit comments