@@ -25,40 +25,6 @@ def test_with_latest_commit_totals_before(self):
2525 ).with_latest_commit_totals_before (datetime .now ().isoformat (), None )[0 ]
2626 assert repo .latest_commit_totals == totals
2727
28- def test_get_aggregated_coverage (self ):
29- CommitFactory (
30- totals = {"n" : 10 , "h" : 5 , "m" : 5 , "p" : 0 , "c" : 50.0 , "C" : 0.0 },
31- repository = self .repo1 ,
32- )
33- CommitFactory (
34- totals = {"n" : 10 , "h" : 10 , "m" : 0 , "p" : 0 , "c" : 100.0 , "C" : 0.0 },
35- repository = self .repo1 ,
36- )
37- CommitFactory (
38- totals = {"n" : 90 , "h" : 40 , "m" : 50 , "p" : 0 , "c" : 60.0 , "C" : 0.0 },
39- repository = self .repo2 ,
40- )
41- CommitFactory (
42- totals = {"n" : 100 , "h" : 50 , "m" : 50 , "p" : 0 , "c" : 50.0 , "C" : 0.0 },
43- repository = self .repo2 ,
44- )
45-
46- stats = (
47- Repository .objects .all ()
48- .with_latest_commit_totals_before (
49- timezone .now ().isoformat (), None , include_previous_totals = True
50- )
51- .get_aggregated_coverage ()
52- )
53-
54- assert stats ["repo_count" ] == 2
55- assert stats ["sum_lines" ] == 110
56- assert stats ["sum_partials" ] == 0
57- # We would expect the weighted coverage to be (54 / 110) * 100
58- assert stats ["weighted_coverage" ] == 54.54545454545454
59- # We would expect the weighted coverage to be (54 / 110) * 100 - (45 / 100) * 100
60- assert stats ["weighted_coverage_change" ] == 9.54545454545454
61-
6228 def test_with_latest_coverage_change (self ):
6329 CommitFactory (totals = {"c" : 99 }, repository = self .repo1 )
6430 CommitFactory (totals = {"c" : 98 }, repository = self .repo1 )
0 commit comments