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_dont_modify_list(self): array = [17, 42, 86, 23, 0, 69] hs = HighScores(array) hs.latest() # don't need to use it assert hs.scores == array
def test_personal_top_three_does_not_change_latest(self): scores = [10, 30, 20] high_scores = HighScores(scores) high_scores.personal_top_three() expected = 20 self.assertEqual(high_scores.latest(), expected)
def test_latest_does_not_change_latest(self): scores = [10, 20, 30] expected = 30 high_scores = HighScores(scores) self.assertEqual(high_scores.latest(), expected) self.assertEqual(high_scores.latest(), expected)
from high_scores import HighScores print('hello world') scores = [30, 50, 20, 70] expected = [30, 50, 20, 70] highScores = HighScores(scores) print(highScores.latest())
def test_latest_score_after_personal_best(self): scores = [20, 70, 15, 25, 30] expected = 30 highscores = HighScores(scores) highscores.personal_best() self.assertEqual(highscores.latest(), expected)
def test_latest_score_after_personal_top_scores(self): scores = [70, 50, 20, 30] expected = 30 highscores = HighScores(scores) highscores.personal_top_three() self.assertEqual(highscores.latest(), expected)