Skip to content

HighScore: Two new tests for methods interference #1744

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions exercises/high-scores/high_scores_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@ def test_personal_top_three_when_there_is_only_one(self):
expected = [40]
self.assertEqual(HighScores(scores).personal_top_three(), expected)

def test_personal_top_three_does_not_break_latest(self):
scores = [20, 10, 30]
expected = 30
high_scores = HighScores(scores)
high_scores.personal_top_three()
self.assertEqual(high_scores.latest(), expected)

def test_personal_best_does_not_break_latest(self):
scores = [20, 30, 10]
expected = 10
high_scores = HighScores(scores)
high_scores.personal_best()
self.assertEqual(high_scores.latest(), expected)


if __name__ == "__main__":
unittest.main()