def _handle_summary(structured_data, **kwds): summary_dict = get_dict_value("summary", structured_data) num_tests = get_dict_value("num_tests", summary_dict) num_failures = get_dict_value("num_failures", summary_dict) num_errors = get_dict_value("num_errors", summary_dict) num_problems = num_failures + num_errors summary_exit_code = EXIT_CODE_OK if num_problems > 0: summary_exit_code = EXIT_CODE_GENERIC_FAILURE elif num_tests == 0: summary_exit_code = EXIT_CODE_NO_SUCH_TARGET summary_style = kwds.get("summary") if summary_style != "none": if num_tests == 0: warn(NO_TESTS_MESSAGE) elif num_problems == 0: info(ALL_TESTS_PASSED_MESSAGE % num_tests) elif num_problems: html_report_file = kwds.get("test_output") message_args = (num_problems, num_tests, html_report_file) message = PROBLEM_COUNT_MESSAGE % message_args warn(message) _summarize_tests_full(structured_data, **kwds) return summary_exit_code
def _handle_summary( structured_data, **kwds ): summary_dict = get_dict_value("summary", structured_data) num_tests = get_dict_value("num_tests", summary_dict) num_failures = get_dict_value("num_failures", summary_dict) num_errors = get_dict_value("num_errors", summary_dict) num_problems = num_failures + num_errors summary_exit_code = EXIT_CODE_OK if num_problems > 0: summary_exit_code = EXIT_CODE_GENERIC_FAILURE elif num_tests == 0: summary_exit_code = EXIT_CODE_NO_SUCH_TARGET summary_style = kwds.get("summary") if summary_style != "none": if num_tests == 0: warn(NO_TESTS_MESSAGE) elif num_problems == 0: info(ALL_TESTS_PASSED_MESSAGE % num_tests) elif num_problems: html_report_file = kwds.get("test_output") message_args = (num_problems, num_tests, html_report_file) message = PROBLEM_COUNT_MESSAGE % message_args warn(message) _summarize_tests_full( structured_data, **kwds ) return summary_exit_code
def _summarize_test_case(structured_data, **kwds): summary_style = kwds.get("summary") test_id = test_structures.case_id( raw_id=get_dict_value("id", structured_data)) status = get_dict_value("status", get_dict_value("data", structured_data)) if status != "success": state = click.style("failed", bold=True, fg='red') else: state = click.style("passed", bold=True, fg='green') click.echo(test_id.label + ": " + state) if summary_style != "minimal": _print_command_line(structured_data, test_id)
def _summarize_test_case(structured_data, **kwds): summary_style = kwds.get("summary") test_id = test_structures.case_id( raw_id=get_dict_value("id", structured_data) ) status = get_dict_value( "status", get_dict_value("data", structured_data) ) if status != "success": state = click.style("failed", bold=True, fg='red') else: state = click.style("passed", bold=True, fg='green') click.echo(test_id.label + ": " + state) if summary_style != "minimal": _print_command_line(structured_data, test_id)
def _summarize_tests_full( structured_data, **kwds ): tests = get_dict_value("tests", structured_data) for test_case_data in tests: _summarize_test_case(test_case_data, **kwds)