コード例 #1
0
 def test_dont_modify_list(self):
     array = [17, 42, 86, 23, 0, 69]
     hs = HighScores(array)
     hs.personal_top_three()  # don't need to use it
     assert hs.scores == array
コード例 #2
0
ファイル: high_scores_test.py プロジェクト: ivenk/exercism
 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)
コード例 #3
0
 def test_scores_after_personal_top_scores(self):
     scores = [30, 50, 20, 70]
     expected = [30, 50, 20, 70]
     highscores = HighScores(scores)
     highscores.personal_top_three()
     self.assertEqual(highscores.scores, expected)
コード例 #4
0
 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)
コード例 #5
0
 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)