@@ -876,6 +876,13 @@ def test_trailing_double_wildcard(self):
876
876
)
877
877
)
878
878
879
+ def test_exclude_include_absolute_path (self ):
880
+ base = make_tree ([], ['a.py' , 'b.py' ])
881
+ assert exclude_paths (
882
+ base ,
883
+ ['/*' , '!' + os .path .join (base , '*.py' )]
884
+ ) == set (['a.py' , 'b.py' ])
885
+
879
886
880
887
class TarTest (unittest .TestCase ):
881
888
def test_tar_with_excludes (self ):
@@ -1026,52 +1033,52 @@ class ShouldCheckDirectoryTest(unittest.TestCase):
1026
1033
1027
1034
def test_should_check_directory_not_excluded (self ):
1028
1035
assert should_check_directory (
1029
- 'not_excluded' , self .exclude_patterns , self .include_patterns
1036
+ 'not_excluded' , self .exclude_patterns , self .include_patterns , '.'
1030
1037
)
1031
1038
assert should_check_directory (
1032
1039
convert_path ('dir/with' ), self .exclude_patterns ,
1033
- self .include_patterns
1040
+ self .include_patterns , '.'
1034
1041
)
1035
1042
1036
1043
def test_shoud_check_parent_directories_of_excluded (self ):
1037
1044
assert should_check_directory (
1038
- 'dir' , self .exclude_patterns , self .include_patterns
1045
+ 'dir' , self .exclude_patterns , self .include_patterns , '.'
1039
1046
)
1040
1047
assert should_check_directory (
1041
1048
convert_path ('dir/with' ), self .exclude_patterns ,
1042
- self .include_patterns
1049
+ self .include_patterns , '.'
1043
1050
)
1044
1051
1045
1052
def test_should_not_check_excluded_directories_with_no_exceptions (self ):
1046
1053
assert not should_check_directory (
1047
1054
'exclude_rather_large_directory' , self .exclude_patterns ,
1048
- self .include_patterns
1055
+ self .include_patterns , '.'
1049
1056
)
1050
1057
assert not should_check_directory (
1051
1058
convert_path ('dir/with/subdir_excluded' ), self .exclude_patterns ,
1052
- self .include_patterns
1059
+ self .include_patterns , '.'
1053
1060
)
1054
1061
1055
1062
def test_should_check_excluded_directory_with_exceptions (self ):
1056
1063
assert should_check_directory (
1057
1064
convert_path ('dir/with/exceptions' ), self .exclude_patterns ,
1058
- self .include_patterns
1065
+ self .include_patterns , '.'
1059
1066
)
1060
1067
assert should_check_directory (
1061
1068
convert_path ('dir/with/exceptions/in' ), self .exclude_patterns ,
1062
- self .include_patterns
1069
+ self .include_patterns , '.'
1063
1070
)
1064
1071
1065
1072
def test_should_not_check_siblings_of_exceptions (self ):
1066
1073
assert not should_check_directory (
1067
1074
convert_path ('dir/with/exceptions/but_not_here' ),
1068
- self .exclude_patterns , self .include_patterns
1075
+ self .exclude_patterns , self .include_patterns , '.'
1069
1076
)
1070
1077
1071
1078
def test_should_check_subdirectories_of_exceptions (self ):
1072
1079
assert should_check_directory (
1073
1080
convert_path ('dir/with/exceptions/like_this_one/subdir' ),
1074
- self .exclude_patterns , self .include_patterns
1081
+ self .exclude_patterns , self .include_patterns , '.'
1075
1082
)
1076
1083
1077
1084
0 commit comments