Esempio n. 1
0
def test_checkmate():
    g = Game()
    g.clear()
    g.add_piece(King("BLACK"), ("H", 8))
    g.add_piece(Queen("WHITE"), ("G", 7))
    g.add_piece(Rook("WHITE"), ("G", 6))
    assert (len(g.board.pieces) == 3)
    g.update_all_pieces()
    g.next_player_turn()
    assert (g.is_check("BLACK"))
    assert (g.is_checkmate("BLACK"))
Esempio n. 2
0
def test_check():
    g = Game()
    g.move(("A", 2), ("D", 7))
    assert (g.is_check("BLACK"))