def test_average(self): contributor_name = 'foo_name' line_count = 100.0 contributor_stats = ContributorStats(contributor_name, line_count) contributor_stats.total_lines_to_consider = 1050.0 average = contributor_stats.average() self.assertAlmostEqual(average, 9.523809523809524, 3)
def create_contribution(self, contributor_name, line_count=100, total_lines_to_consider=1050.0): contributor_stats = ContributorStats(contributor_name, line_count) contributor_stats.total_lines_to_consider = total_lines_to_consider return contributor_stats