@@ -128,6 +128,12 @@ def test_ProcessIgnore_with_multiple_ignores(self):
128128 ]
129129 self .check_ProcessIgnore (test_dir , expected , ignore )
130130
131+ def test_ProcessIgnore_process_codebase_does_not_fail_to_access_an_ignored_resourced_cached_to_disk (self ):
132+ test_dir = self .extract_test_tar ('plugin_ignore/user.tgz' )
133+ codebase = Codebase (test_dir , max_in_memory = 1 )
134+ test_plugin = ProcessIgnore ()
135+ ignore = ['test' ]
136+ test_plugin .process_codebase (codebase , ignore = ignore )
131137
132138
133139class TestScanPluginIgnoreFiles (FileDrivenTesting ):
@@ -235,3 +241,19 @@ def test_scancode_multiple_ignores(self):
235241 assert 0 == scan_result ['headers' ][0 ]['extra_data' ]['files_count' ]
236242 scan_locs = [x ['path' ] for x in scan_result ['files' ]]
237243 assert [u'user' , u'user/src' ] == scan_locs
244+
245+ def test_scancode_codebase_attempt_to_access_an_ignored_resourced_cached_to_disk (self ):
246+ test_dir = self .extract_test_tar ('plugin_ignore/user.tgz' )
247+ result_file = self .get_temp_file ('json' )
248+ args = ['--copyright' , '--strip-root' , '--ignore' , 'test' , test_dir , '--max-in-memory' , '1' , '--json' , result_file ]
249+ run_scan_click (args )
250+ scan_result = load_json_result (result_file )
251+ assert 2 == scan_result ['headers' ][0 ]['extra_data' ]['files_count' ]
252+ scan_locs = [x ['path' ] for x in scan_result ['files' ]]
253+ expected = [
254+ u'user' ,
255+ u'user/ignore.doc' ,
256+ u'user/src' ,
257+ u'user/src/ignore.doc' ,
258+ ]
259+ assert expected == scan_locs
0 commit comments