Exemple #1
0
 def test_squares_equal_with_same_squares(self):
     """
     If all the squares in the list have the same piece in them, the function should return true.
     """
     board = Board()
     board.set_square(1, 'X')
     board.set_square(2, 'X')
     board.set_square(3, 'X')
     self.assertTrue(board.squares_equal((1, 2, 3)))
Exemple #2
0
 def test_squares_equal_with_different_squares(self):
     """
     If the squares aren't the same, the function should return false.
     """
     board = Board()
     board.set_square(1, 'X')
     board.set_square(2, 'O')
     board.set_square(3, 'X')
     self.assertFalse(board.squares_equal((1, 2, 3)))
Exemple #3
0
 def test_squares_equal_with_blank_squares(self):
     """
     If any squares are 'None', the function should return false, even if all the squares given are the same.
     """
     board = Board()
     self.assertFalse(board.squares_equal((1, 2, 3)))
Exemple #4
0
 def test_squares_equal_with_blank_list(self):
     """
     Trying to call 'squares_equal' with a blank list or tuple should return true.
     """
     board = Board()
     self.assertTrue(board.squares_equal(()))