Example #1
0
 def test_land_on_barrier_or_rock(self):
     self.board[1, 4] = knight.Piece.rock
     move_type = knight._classify_move(self.board, self.move,
                                       self.transports, self.start_x,
                                       self.start_y)
     self.assertEqual(move_type, knight.Move.blocked)
     self.board[1, 4] = knight.Piece.barrier
     move_type = knight._classify_move(self.board, self.move,
                                       self.transports, self.start_x,
                                       self.start_y)
     self.assertEqual(move_type, knight.Move.blocked)
Example #2
0
 def test_lava(self):
     self.board[1, 4] = knight.Piece.lava
     move_type = knight._classify_move(self.board, self.move,
                                       self.transports, self.start_x,
                                       self.start_y)
     self.assertEqual(move_type, knight.Move.lava)
Example #3
0
 def test_winning(self):
     self.board[1, 4] = knight.Piece.final
     move_type = knight._classify_move(self.board, self.move,
                                       self.transports, self.start_x,
                                       self.start_y)
     self.assertEqual(move_type, knight.Move.winning)
Example #4
0
 def test_over_rock(self):
     self.board[0, 4] = knight.Piece.rock
     move_type = knight._classify_move(self.board, self.move,
                                       self.transports, self.start_x,
                                       self.start_y)
     self.assertEqual(move_type, self.move_type)
Example #5
0
 def test_cant_pass_barrier(self):
     self.board[0, 4] = knight.Piece.barrier
     move_type = knight._classify_move(self.board, self.move,
                                       self.transports, self.start_x,
                                       self.start_y)
     self.assertEqual(move_type, knight.Move.blocked)
Example #6
0
 def test_off_board(self):
     move_type = knight._classify_move(self.board, -2, self.transports,
                                       self.start_x, self.start_y)
     self.assertEqual(move_type, knight.Move.off_board)
Example #7
0
 def test_normal(self):
     move_type = knight._classify_move(self.board, self.move,
                                       self.transports, self.start_x,
                                       self.start_y)
     self.assertEqual(move_type, self.move_type)