def min_group_scorer(test_results): """Gets minimal result of all tests inside a test group.""" scores = [ScoreValue.deserialize(result["score"]) for result in test_results.itervalues()] score = min(scores) status = aggregate_statuses([result["status"] for result in test_results.itervalues()]) return score, status
def sum_score_aggregator(group_results): if not group_results: return None, "OK" scores = [ScoreValue.deserialize(result["score"]) for result in group_results.itervalues()] score = sum(scores[1:], scores[0]) status = aggregate_statuses([result["status"] for result in group_results.itervalues()]) return score, status
def sum_group_scorer(test_results): """Adds results of all tests inside a test group.""" if not test_results: return None, "OK" scores = [ScoreValue.deserialize(result["score"]) for result in test_results.itervalues()] score = sum(scores[1:], scores[0]) status = aggregate_statuses([result["status"] for result in test_results.itervalues()]) return score, status
def min_group_scorer(test_results): """Gets minimal result of all tests inside a test group.""" scores = [ ScoreValue.deserialize(result['score']) for result in test_results.itervalues() ] score = min(scores) status = aggregate_statuses( [result['status'] for result in test_results.itervalues()]) return score, status
def sum_score_aggregator(group_results): if not group_results: return None, 'OK' scores = [ ScoreValue.deserialize(result['score']) for result in group_results.itervalues() ] score = sum(scores[1:], scores[0]) status = aggregate_statuses( [result['status'] for result in group_results.itervalues()]) return score, status
def sum_group_scorer(test_results): """Adds results of all tests inside a test group.""" if not test_results: return None, 'OK' scores = [ ScoreValue.deserialize(result['score']) for result in test_results.itervalues() ] score = sum(scores[1:], scores[0]) status = aggregate_statuses( [result['status'] for result in test_results.itervalues()]) return score, status
def sum_score_aggregator(group_results): if not group_results: return None, None, 'OK' scores = [ScoreValue.deserialize(result['score']) for result in group_results.itervalues()] max_scores = [ScoreValue.deserialize(result['max_score']) for result in group_results.itervalues()] score = sum(scores[1:], scores[0]) max_score = sum(max_scores[1:], max_scores[0]) status = aggregate_statuses([result['status'] for result in group_results.itervalues()]) return score, max_score, status
def sum_group_scorer(test_results): """Adds results of all tests inside a test group.""" if not test_results: return None, None, 'OK' scores = [ScoreValue.deserialize(result['score']) for result in six.itervalues(test_results)] max_scores = [ScoreValue.deserialize(result['max_score']) for result in six.itervalues(test_results)] score = sum(scores[1:], scores[0]) max_score = sum(max_scores[1:], max_scores[0]) status = aggregate_statuses([result['status'] for result in six.itervalues(test_results)]) return score, max_score, status
def sum_score_aggregator(group_results): if not group_results: return None, None, 'OK' scores = [ScoreValue.deserialize(result['score']) for result in six.itervalues(group_results)] max_scores = [ScoreValue.deserialize(result['max_score']) for result in six.itervalues(group_results)] # the sum below needs a start value of an appropriate type, # the default zero is not suitable score = sum(scores[1:], scores[0]) max_score = sum(max_scores[1:], max_scores[0]) status = aggregate_statuses([result['status'] for result in six.itervalues(group_results)]) return score, max_score, status
def sum_score_aggregator(group_results): if not group_results: return None, None, 'OK' scores = [ScoreValue.deserialize(result['score']) for result in group_results.itervalues()] max_scores = [ScoreValue.deserialize(result['max_score']) for result in group_results.itervalues()] # the sum below needs a start value of an appropriate type, # the default zero is not suitable score = sum(scores[1:], scores[0]) max_score = sum(max_scores[1:], max_scores[0]) status = aggregate_statuses([result['status'] for result in group_results.itervalues()]) return score, max_score, status
def min_group_scorer(test_results): """Gets minimal result of all tests inside a test group.""" scores = [ScoreValue.deserialize(result['score']) for result in test_results.itervalues()] max_scores = [ScoreValue.deserialize(result['max_score']) for result in test_results.itervalues()] score = min(scores) max_score = min(max_scores) if max_score != max(max_scores): raise UnequalMaxScores("Tests in one group cannot " "have different max scores.") sorted_results = sorted(test_results.values(), key=itemgetter('order')) status = aggregate_statuses([result['status'] for result in sorted_results]) return score, max_score, status
def acm_group_scorer(test_results): status = aggregate_statuses([result['status'] for result in test_results.itervalues()]) return None, None, status
def acm_score_aggregator(group_results): if not group_results: return None, None, 'OK' status = aggregate_statuses([result['status'] for result in group_results.itervalues()]) return BinaryScore(status == 'OK'), BinaryScore(True), status