def test_white_king_in_check(self): b = Board(".nbqkbnr", #8 "pppppppp", #7 "........", #6 "........", #5 "r...K...", #4 "........", #3 "PPPPPPPP", #2 "RNBQ.BNR", #1 #abcdefgh ) moves = b.in_check(White) self.assertEqual(moves, True)
def test_white_king_not_in_check(self): b = Board("rnbqkbnr", #8 "pppppppp", #7 "........", #6 "R.......", #5 "........", #4 "........", #3 "PPPPPPPP", #2 ".NBQKBNR", #1 #abcdefgh ) moves = b.in_check(White) self.assertEqual(moves, False)
def test_black_king_in_check(self): b = Board("rnbq.bnr", #8 "pppppppp", #7 "........", #6 "R..k....", #5 "........", #4 "........", #3 "PPPPPPPP", #2 ".NBQKBNR", #1 #abcdefgh ) moves = b.in_check(Black) self.assertEqual(moves, True)