Skip to content
Snippets Groups Projects
Commit 0e7664fb authored by Usman Khalid's avatar Usman Khalid
Browse files

test: Fix failing pytest asserts in GradesheetTest.test_weighted_grading.

parent 8a8dbee3
Branches
Tags
No related merge requests found
......@@ -43,14 +43,14 @@ class GradesheetTest(unittest.TestCase):
agg_fields['first_attempted'] = now
scores.append(ProblemScore(weighted_earned=3, weighted_possible=5, graded=True, **prob_fields))
all_total, graded_total = aggregate_scores(scores)
assert round(all_total - AggregatedScore(tw_earned=3, tw_possible=10, graded=False, **agg_fields), 7) >= 0
assert round(graded_total - AggregatedScore(tw_earned=3, tw_possible=5, graded=True, **agg_fields), 7) >= 0
assert all_total == AggregatedScore(tw_earned=3, tw_possible=10, graded=False, **agg_fields)
assert graded_total == AggregatedScore(tw_earned=3, tw_possible=5, graded=True, **agg_fields)
# (0/5 non-graded) + (3/5 graded) + (2/5 graded) = 5/15 total, 5/10 graded
scores.append(ProblemScore(weighted_earned=2, weighted_possible=5, graded=True, **prob_fields))
all_total, graded_total = aggregate_scores(scores)
assert round(all_total - AggregatedScore(tw_earned=5, tw_possible=15, graded=False, **agg_fields), 7) >= 0
assert round(graded_total - AggregatedScore(tw_earned=5, tw_possible=10, graded=True, **agg_fields), 7) >= 0
assert all_total == AggregatedScore(tw_earned=5, tw_possible=15, graded=False, **agg_fields)
assert graded_total == AggregatedScore(tw_earned=5, tw_possible=10, graded=True, **agg_fields)
@ddt.ddt
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment