Esempio n. 1
0
    def test_valide_selected_cell(self):
        board = ChessBoard()
        player = 0
        board.set_allowed_color(player)
        selected_figure = Point(5, 5)

        # Test 1
        selected_figure.set_info("  ")
        self.assertTrue(board._invalid_selection(selected_figure))

        # Test 2
        selected_figure.set_info("wp")
        self.assertFalse(board._invalid_selection(selected_figure))

        # Test 3
        player = 1
        board.set_allowed_color(player)

        selected_figure.set_info("wp")
        self.assertTrue(board._invalid_selection(selected_figure))
Esempio n. 2
0
    def test_set_info_about_certain_cell(self):
        cell = Point(0, 0, "br")
        cell.set_info("wr")

        self.assertEqual(cell._info, "wr")