Exemplo n.º 1
0
 def test_resource_paths_with_glob_file(self):
     test_dir = self.extract_test_tar('ignore/user.tgz')
     expected = [
         'user',
         'user/src',
         'user/src/test',
         'user/src/test/sample.txt'
     ]
     test = [rel_path for abs_path, rel_path in resource_paths(test_dir,{'*.doc': 'test ignore'})]
     assert expected == sorted(test)
Exemplo n.º 2
0
 def test_resource_paths_with_glob_file(self):
     test_dir = self.extract_test_tar('ignore/user.tgz')
     test_plugin = ProcessIgnore(('*.doc', ))
     scan_cache_class = get_scans_cache_class(self.get_temp_dir())
     expected = [
         'user', 'user/src', 'user/src/test', 'user/src/test/sample.txt'
     ]
     test = [
         resource.rel_path for resource in resource_paths(
             test_dir, False, scan_cache_class, [test_plugin])
     ]
     assert expected == sorted(test)
 def test_resource_paths_with_glob_path(self):
     test_dir = self.extract_test_tar('ignore/user.tgz')
     test_plugin = ProcessIgnore(('*/src/test',))
     scan_cache_class = get_scans_cache_class(self.get_temp_dir())
     expected = [
         'user',
         'user/ignore.doc',
         'user/src',
         'user/src/ignore.doc'
     ]
     test = [resource.rel_path for resource in resource_paths(test_dir, False, scan_cache_class, [test_plugin])]
     assert expected == sorted(test)
Exemplo n.º 4
0
 def test_resource_paths_with_multiple_plugins(self):
     test_dir = self.extract_test_tar('ignore/user.tgz')
     scan_cache_class = get_scans_cache_class(self.get_temp_dir())
     test_plugins = [
         ProcessIgnore(('*.doc', )),
         ProcessIgnore(('*/src/test/*', ))
     ]
     expected = ['user', 'user/src', 'user/src/test']
     test = [
         resource.rel_path for resource in resource_paths(
             test_dir, False, scan_cache_class, test_plugins)
     ]
     assert expected == sorted(test)
 def test_resource_paths_with_multiple_plugins(self):
     test_dir = self.extract_test_tar('ignore/user.tgz')
     scan_cache_class = get_scans_cache_class(self.get_temp_dir())
     test_plugins = [
         ProcessIgnore(('*.doc',)),
         ProcessIgnore(('*/src/test/*',))
     ]
     expected = [
         'user',
         'user/src',
         'user/src/test'
     ]
     test = [resource.rel_path for resource in resource_paths(test_dir, False, scan_cache_class, test_plugins)]
     assert expected == sorted(test)