@@ -55,9 +55,11 @@ def get_results(
5555 def test_basic_usage (self , path ):
5656 results = self .get_results (path = path )
5757
58- assert len (results .keys ()) == 2
58+ assert len (results .keys ()) == 4
5959 assert len (results ['test_data/files/file_with_secrets.py' ]) == 1
6060 assert len (results ['test_data/files/tmp/file_with_secrets.py' ]) == 2
61+ assert len (results ['test_data/files/file with secrets.py' ]) == 2
62+ assert len (results ['test_data/files/tmp/file with secrets.py' ]) == 1
6163
6264 @pytest .mark .parametrize (
6365 'path' ,
@@ -92,8 +94,8 @@ def test_with_multiple_files(self):
9294
9395 assert len (results ['test_data/files/file_with_secrets.py' ]) == 1
9496 assert len (results ['test_data/files/tmp/file_with_secrets.py' ]) == 2
95- assert 'test_data/files/file_with_secrets .py' in results
96- assert 'test_data/files/tmp/file_with_secrets .py' in results
97+ assert 'test_data/files/file with secrets .py' not in results
98+ assert 'test_data/files/tmp/file with secrets .py' not in results
9799
98100 def test_with_multiple_non_existent_files (self ):
99101 with mock .patch (
@@ -123,20 +125,25 @@ def test_with_folders_and_files(self):
123125 assert 'test_data/files/file_with_secrets.py' in results
124126 assert 'test_data/files/tmp/file_with_secrets.py' in results
125127 assert 'test_data/files/file_with_no_secrets.py' not in results
128+ assert 'test_data/files/file with secrets.py' in results
129+ assert 'test_data/files/tmp/file with secrets.py' in results
126130 assert 'non-existent-file.B' not in results
127131
128132 def test_exclude_regex (self ):
129133 results = self .get_results (exclude_files_regex = 'tmp*' )
130134
131- assert len (results .keys ()) == 1
135+ assert len (results .keys ()) == 2
132136 assert 'test_data/files/file_with_secrets.py' in results
137+ assert 'test_data/files/file with secrets.py' in results
133138
134139 def test_exclude_regex_at_root_level (self ):
135140 results = self .get_results (exclude_files_regex = 'file_with_secrets.py' )
136141
137142 # All files_with_secrets.py should be ignored, both at the root
138143 # level, and the nested file in tmp.
139- assert not results
144+ assert len (results .keys ()) == 2
145+ assert 'test_data/files/file with secrets.py' in results
146+ assert 'test_data/files/tmp/file with secrets.py' in results
140147
141148 def test_no_files_in_git_repo (self ):
142149 with mock_git_calls (
@@ -170,7 +177,7 @@ def test_scan_all_files(self):
170177 path = ['test_data/files' ],
171178 scan_all_files = True ,
172179 )
173- assert len (results .keys ()) == 2
180+ assert len (results .keys ()) == 4
174181
175182 def test_scan_all_files_with_bad_symlinks (self ):
176183 with mock .patch (
0 commit comments