Exemplo n.º 1
0
 def test_incomplete_alg_piece_movement_with_file_specified_alt(self):
     self.assertEqual(
         converter.incomplete_alg("Ngf3", color.white, self.test_board),
         Move(
             end_loc=Location.from_string("f3"),
             piece=Knight(color.white, Location.from_string("g1")),
             status=notation_const.MOVEMENT,
             start_loc=Location.from_string("g1")
         )
     )
Exemplo n.º 2
0
 def test_incomplete_alg_pawn_movement(self):
     self.assertEqual(
         converter.incomplete_alg("e4", color.white, self.test_board),
         Move(
             end_loc=Location.from_string("e4"),
             piece=Pawn(color.white, Location.from_string("e4")),
             status=notation_const.MOVEMENT,
             start_loc=Location.from_string("e2")
         )
     )
Exemplo n.º 3
0
 def test_incomplete_alg_piece_capture(self):
     self.test_board.update(converter.short_alg("Nf3", color.white, self.test_board))
     self.test_board.update(converter.short_alg("e5", color.black, self.test_board))
     self.assertEqual(
         converter.incomplete_alg("Nxe5", color.white, self.test_board),
         Move(
             end_loc=Location.from_string("e5"),
             piece=Knight(color.white, Location.from_string("f3")),
             status=notation_const.CAPTURE,
             start_loc=Location.from_string("f3")
         )
     )
Exemplo n.º 4
0
 def test_incomplete_alg_pawn_promotion_with_capture(self):
     self.test_board.move_piece(Location.from_string("a2"), Location.from_string("a7"))
     self.assertEqual(
         converter.incomplete_alg("axb8=R", color.white, self.test_board),
         Move(
             end_loc=Location.from_string("b8"),
             piece=Pawn(color.white, Location.from_string("a7")),
             status=notation_const.CAPTURE_AND_PROMOTE,
             promoted_to_piece=Rook,
             start_loc=Location.from_string("a7")
         )
     )
Exemplo n.º 5
0
 def test_incomplete_alg_pawn_promotion(self):
     self.test_board.move_piece(Location.from_string("a2"), Location.from_string("a7"))
     self.test_board.remove_piece_at_square(Location.from_string("a8"))
     self.assertEqual(
         converter.incomplete_alg("a8=Q", color.white, self.test_board),
         Move(
             end_loc=Location.from_string("a8"),
             piece=Pawn(color.white, Location.from_string("e7")),
             status=notation_const.PROMOTE,
             promoted_to_piece=Queen,
             start_loc=Location.from_string("a7")
         )
     )