コード例 #1
0
ファイル: polyglot.py プロジェクト: vgupta2507/pychess
    def testPolyglot_1(self):
        """Testing hash keys agree with Polyglot's"""

        for testcase in testcases:
            board = LBoard(Board)
            board.applyFen(testcase[0])
            self.assertEqual(board.hash, testcase[1])
コード例 #2
0
ファイル: frc_castling.py プロジェクト: rajrakeshdr/pychess
    def testFRCCastling(self):
        """Testing FRC castling movegen"""
        print()

        for fen, castles in data:
            print(fen)
            board = LBoard(FISCHERRANDOMCHESS)
            board.applyFen(fen)
            #print board
            moves = [move for move in genCastles(board)]
            self.assertEqual(len(moves), len(castles))
            for i, castle in enumerate(castles):
                kfrom, kto, flag = castle
                self.assertEqual(moves[i], newMove(kfrom, kto, flag))
コード例 #3
0
 def setUp(self):
     self.board = LBoard(Board)
     self.board.applyFen(FEN)