Beispiel #1
0
    def test_empty_node_first(self):
        game_node = GameNode()
        game_node.empty = [Point(1, 1)]
        game_node.move = Move(Stone.White, Point(1, 1))
        board = self.create_board_13x13()
        board.apply(game_node)

        board_expected = self.create_board_13x13()
        board_expected[1, 1] = Node(stone=Stone.White)
        self.assertEqual(board_expected, board)
Beispiel #2
0
    def test_apply_move(self):
        game_node = GameNode()
        game_node.add_black = [Point(2, 2), Point(12, 12)]
        game_node.add_white = [Point(3, 3), Point(11, 11)]
        game_node.empty = [Point(1, 1)]
        game_node.move = Move(Stone.Black, Point(7, 7))
        game_node.markups = [(Triangle(), Point(7, 7)), (Circle(), Point(5, 5))]

        board = self.create_board_13x13()
        board.apply(game_node)

        board_expected = self.create_board_13x13()
        board_expected[1, 1] = None
        board_expected[2, 2] = Node(stone=Stone.Black)
        board_expected[12, 12] = Node(stone=Stone.Black)
        board_expected[3, 3] = Node(stone=Stone.White)
        board_expected[11, 11] = Node(stone=Stone.White)
        board_expected[5, 5] = Node(marker=Circle())
        board_expected[7, 7] = Node(stone=Stone.Black, marker=Triangle())

        self.assertEqual(board_expected, board)