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)
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)
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)
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)
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)
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)
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)