Пример #1
0
 def test_return_a_list_of_2_elements(self):
     self.assertEqual(len(Mastermind.call(BASIC_SECRET, BASIC_SECRET)), 2)
Пример #2
0
 def test_return_a_list_of_0_and_1_for_one_misplaced_color(self):
     self.assertEqual(
         Mastermind.call(BASIC_SECRET, ['pink', 'pink', 'pink', 'blue']),
         [0, 1])
Пример #3
0
 def test_return_a_list_of_0_and_4_for_all_misplaced_colors(self):
     self.assertEqual(
         Mastermind.call(BASIC_SECRET, ['yellow', 'red', 'green', 'blue']),
         [0, 4])
Пример #4
0
 def test_return_a_list_of_0_and_0_for_a_completely_wrong_match(self):
     self.assertEqual(
         Mastermind.call(BASIC_SECRET, ['pink', 'pink', 'pink', 'pink']),
         [0, 0])
Пример #5
0
 def test_return_a_list_of_2_and_0_for_two_missing_colors(self):
     self.assertEqual(
         Mastermind.call(BASIC_SECRET, ['pink', 'pink', 'red', 'green']),
         [2, 0])
Пример #6
0
 def test_return_a_list_of_3_and_0_for_one_missing_color(self):
     self.assertEqual(
         Mastermind.call(BASIC_SECRET, ['pink', 'yellow', 'red', 'green']),
         [3, 0])
Пример #7
0
 def test_return_a_list_of_4_and_0_for_a_perfect_match(self):
     self.assertEqual(Mastermind.call(BASIC_SECRET, BASIC_SECRET), [4, 0])
Пример #8
0
 def test_return_a_list_of_2_integers(self):
     list_result = Mastermind.call(BASIC_SECRET, BASIC_SECRET)
     self.assertEqual(type(list_result[0]), int)
     self.assertEqual(type(list_result[1]), int)