def test_promotion(self): board = Board(4, 2) board.add(Pawn, (0, 0), Color.WHITE) for i in range(3): board.move((0, i), (0, i + 1)) board.promote((0, 3), Queen) self.assertEqual(Queen, board.get((0, 3))[1])
def test_move(self): board = Board(4, 2) board.add(Queen, (0, 0), Color.WHITE) board.add(Queen, (3, 3), Color.BLACK) self.assertEqual(2, len(board.board)) board.move((0, 0), (3, 3)) self.assertEqual(1, len(board.board))