Fix attack to tests
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import unittest
|
||||
from binding.python_c_ffi import ChessFFI
|
||||
from test.chess_ffi import Board
|
||||
from test.chess_ffi import KING_ATTACKS
|
||||
from test.chess_ffi import KNIGHT_ATTACKS
|
||||
@@ -11,6 +12,9 @@ from test.chess_ffi import load_fen
|
||||
class ChessLibTestBase(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.chess_ffi = ChessFFI()
|
||||
|
||||
|
||||
init_attack_caches()
|
||||
|
||||
cls.KNIGHT_ATTACKS = KNIGHT_ATTACKS
|
||||
@@ -25,8 +29,8 @@ class ChessLibTestBase(unittest.TestCase):
|
||||
|
||||
def load_fen(self, fen, board=None):
|
||||
if board:
|
||||
return load_fen(board, fen)
|
||||
return load_fen(self.board, fen)
|
||||
return self.chess_ffi.load_fen(board, fen)
|
||||
return self.chess_ffi.load_fen(self.board, fen)
|
||||
|
||||
|
||||
def gen(self, captures_only: bool = False, cap: int = 256):
|
||||
|
||||
Reference in New Issue
Block a user