示例#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)
示例#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)
示例#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)