Ejemplo n.º 1
0
 def test_moves_blocked_enemy(self):
     bishop = Bishop(self.white, (0, 0))
     knight = Knight(self.black, (1, 1))
     self.board.add_piece(bishop)
     self.board.add_piece(knight)
     moves = list(bishop.moves(self.board))
     self.assertEquals(len(moves), 1, moves)
Ejemplo n.º 2
0
 def test_moves_corner(self):
     bishop = Bishop(self.white, (0, 0))
     self.board.add_piece(bishop)
     moves = list(bishop.moves(self.board))
     self.assertEquals(len(moves), 7, moves)
Ejemplo n.º 3
0
 def test_moves_center(self):
     bishop = Bishop(self.white, (4, 4))
     self.board.add_piece(bishop)
     moves = list(bishop.moves(self.board))
     self.assertEquals(len(moves), 13, moves)