def print_summary(cls, path): """ Function is used for printing summary informations :return: """ for key, value in six.iteritems(OutputLogger.get_summary_info()): logger.info("%s %s\n", key, value) try: LoggerHelper.add_file_handler(logger_report, path) except (OSError, IOError): raise RebaseHelperError("Can not create results file '%s'" % path) type_pkgs = ['old', 'new'] if OutputLogger.get_patches(): cls.print_patches(OutputLogger.get_patches(), '\nSummary information about patches:') for pkg in type_pkgs: type_pkg = OutputLogger.get_build(pkg) if type_pkg: cls.print_rpms(type_pkg, pkg.capitalize()) cls.print_build_logs(type_pkg, pkg.capitalize()) cls.print_pkgdiff_tool()
def print_summary(cls, path): """ Function is used for printing summary informations :return: """ # First of all we would like to print all # summary information OutputLogger.set_info_text("Summary output is also available in log:", path) logger.info('\n') for key, value in six.iteritems(OutputLogger.get_summary_info()): logger.info("%s %s\n", key, value) try: LoggerHelper.add_file_handler(logger_output, path) except (OSError, IOError): raise RebaseHelperError("Can not create results file '%s'", path) type_pkgs = ['old', 'new'] cls.print_patches(OutputLogger.get_patches(), '\nSummary information about patches:') for pkg in type_pkgs: type_pkg = OutputLogger.get_build(pkg) if type_pkg: cls.print_rpms(type_pkg, pkg.capitalize()) cls.print_build_logs(type_pkg, pkg.capitalize()) cls.print_pkgdiff_tool()
def get_rebased_patches(self): """ Function returns a list of patches either '': [list_of_deleted_patches] :return: """ patches = False output_patch_string = [] if OutputLogger.get_patches(): for key, val in six.iteritems(OutputLogger.get_patches()): if key: output_patch_string.append('Following patches have been %s:\n%s' % (key, val)) patches = True if not patches: output_patch_string.append('Patches were not touched. All were applied properly') return output_patch_string
def test_base_output_patches(self): """ Test Output logger patches :return: """ patch_results = OutputLogger.get_patches() expected_patches = self.patches_data assert patch_results == expected_patches