Exemplo n.º 1
0
    def test_move_chosen(self):
        ruleset1 = StandardRules()
        really_new_game = game.Game('p1', 'p2')
        test_minimax = minimax.Minimax(really_new_game)

        assert test_minimax.minimaxRoot(1, test_minimax.game.board,
                                        True) == [[6, 0], [4, 0]]
 def test_scholars_mate_is_checkmate(self, run_before_tests):
         test_game1 = Game("p1", "p2", ruleset = StandardRules())
         test_game1.execute_turn(6,4,4,4)
         test_game1.execute_turn(1,4,3,4)
         test_game1.execute_turn(7,5,4,2)
         test_game1.execute_turn(1,0,2,0)
         test_game1.execute_turn(7,3,5,5)
         test_game1.execute_turn(2,0,3,0)
         test_game1.execute_turn(5,5,1,5)
         assert Checkmate(test_game1).is_checkmate() == True
Exemplo n.º 3
0
def run_before_tests():
    ruleset = StandardRules()
    new_game = game.Game('p1', 'p2', ruleset)
    test_minimax = minimax.Minimax(new_game)
    return test_minimax
Exemplo n.º 4
0
def run_before_tests():
    test_game = game.Game('p1', 'p2', ruleset=StandardRules())
    return test_game
def run_before_tests():
    test_game = Game("p1", "p2", ruleset=StandardRules())
    return test_game
def run_before_tests():
        test_game = game.Game('Player_1', 'Player_2', ruleset = StandardRules())
        return test_game
Exemplo n.º 7
0
from piece import Piece
from standard_rules import StandardRules
import pytest
import game
import pawn

test_game = game.Game('test1', 'test2', ruleset=StandardRules())


class TestGame:
    def test_game_to_have_player_1_start(self):
        assert test_game.p1_turn == True

    def test_game_moves_to_log(self):
        test_game.execute_turn('6', '0', '4', '0')
        test_game.execute_turn('1', '7', '3', '7')
        assert test_game.log[0] == ['White', 6, 0, 4, 0]
        assert test_game.log[1] == ['Black', 1, 7, 3, 7]

    def test_move_other_player_figure_prohibited(self):
        assert test_game.p1_turn == True
        assert test_game.execute_turn('1', '6', '3', '6') == 'invalid move'
def run_before_tests():
        test_game = Game("p1", "p2", ruleset = StandardRules())
        test_checkmate = Checkmate(test_game)
        return test_checkmate