def test_personal_top_three_from_a_list_of_scores(self):
     scores = [10, 30, 90, 30, 100, 20, 10, 0, 30, 40, 40, 70, 70]
     expected = [100, 90, 70]
     assert personal_top_three(scores) == expected
 def test_personal_top_highest_to_lowest(self):
     scores = [20, 10, 30]
     expected = [30, 20, 10]
     assert personal_top_three(scores) == expected
 def test_return_3_from_list(self):
     self.assertEqual(3, len(personal_top_three(self.scores_1)))
Beispiel #4
0
 def test_run_multiple_queries(self):
     scores = [10, 20, 30, 40, 50, 45]
     self.assertEqual(latest(scores), 45)
     self.assertEqual(personal_top_three(scores), [50, 45, 40])
 def test_personal_top_three_highest_to_lowest(self):
     scores = [20, 10, 30]
     expected = [30, 20, 10]
     self.assertEqual(personal_top_three(scores), expected)
 def test_personal_top_three_when_there_are_less_than_3(self):
     scores = [30, 70]
     expected = [70, 30]
     self.assertEqual(personal_top_three(scores), expected)
 def test_personal_top_three_highest_to_lowest(self):
     scores = [20, 10, 30]
     expected = [30, 20, 10]
     self.assertEqual(personal_top_three(scores), expected)
 def test_personal_top_when_there_is_only_one(self):
     scores = [40]
     expected = [40]
     assert personal_top_three(scores) == expected
 def test_top_three_with_one_given(self):
     self.assertEqual([7], personal_top_three(self.scores_4))
 def test_personal_top_three_from_a_long_list(self):
     scores = [10, 30, 90, 30, 100, 20, 10, 0, 30, 40, 40, 70, 70]
     expected = [100, 90, 70]
     self.assertEqual(personal_top_three(scores), expected)
 def test_top_three_with_less_than_three_given(self):
     self.assertEqual([8, 4], personal_top_three(self.scores_3))
 def test_top_three_with_tie(self):
     self.assertEqual([9, 8, 8], personal_top_three(self.scores_2))
 def test_3_highest_scores_returned(self):
     self.assertEqual([9, 8, 6], personal_top_three(self.scores_1))
 def test_personal_top_when_there_is_a_tie(self):
     scores = [40, 20, 40, 30]
     expected = [40, 40, 30]
     assert personal_top_three(scores) == expected
 def test_personal_top_three_when_there_is_a_tie(self):
     scores = [40, 20, 40, 30]
     expected = [40, 40, 30]
     self.assertEqual(personal_top_three(scores), expected)
 def test_personal_top_when_there_are_less_than_3(self):
     scores = [30, 70]
     expected = [70, 30]
     assert personal_top_three(scores) == expected
 def test_personal_top_three_when_there_are_less_than_3(self):
     scores = [30, 70]
     expected = [70, 30]
     self.assertEqual(personal_top_three(scores), expected)
 def test_personal_top_three_from_a_long_list(self):
     scores = [10, 30, 90, 30, 100, 20, 10, 0, 30, 40, 40, 70, 70]
     expected = [100, 90, 70]
     self.assertEqual(personal_top_three(scores), expected)
 def test_personal_top_three_when_there_is_only_one(self):
     scores = [40]
     expected = [40]
     self.assertEqual(personal_top_three(scores), expected)
 def test_personal_top_three_when_there_is_a_tie(self):
     scores = [40, 20, 40, 30]
     expected = [40, 40, 30]
     self.assertEqual(personal_top_three(scores), expected)
Beispiel #21
0
 def test_personal_top_without_losing_data(self):
     scores = [20, 10, 30]
     personal_top_three(scores)
     self.assertEqual(scores, [20, 10, 30])
 def test_personal_top_three_when_there_is_only_one(self):
     scores = [40]
     expected = [40]
     self.assertEqual(personal_top_three(scores), expected)
 def test_personal_top_three_from_a_list_of_scores(self):
     scores = [1, 5, 3, 2]
     expected = [5, 3, 2]
     self.assertEqual(personal_top_three(scores), expected)