def extract_items_from_dir(self): detach_files_list: list = [] all_files = glob.glob(f'{self.file_path}/**/*', recursive=True) for file_path in all_files: if os.path.isfile(file_path) and self.is_valid_file_for_detach( file_path): file_type = self.find_item_type_to_detach(file_path) file_data = get_file(file_path, file_type) file_id = file_data.get('id') if file_id: detach_files_list.append({ 'file_id': file_id, 'file_type': file_type, 'file_path': file_path }) return detach_files_list
def test_get_file_exception(self): path_to_here = f'{git_path()}/demisto_sdk/tests/test_files/' assert get_file(json.load, os.path.join(path_to_here, 'fake_integration.yml'), ('yml', 'yaml')) == {}
def find_item_id_to_detach(self): file_type = self.find_item_type_to_detach(self.file_path) file_data = get_file(self.file_path, file_type) file_id = file_data.get('id') return file_id