input: Write a python function to test the insertion and deletion operations of a max-heap.
  ```python
  def test_heap_operations():
      heap = Heap()
      heap.insert(10)
      heap.insert(20)
      heap.insert(5)
      heap.insert(30)
      assert heap.heap_array == [30, 20, 5, 10]
  
      heap.delete(1)  # delete the element at index 1
      assert heap.heap_array == [30, 10, 5]
      
      heap.insert(25)
      assert heap.heap_array == [30, 25, 5, 10]
  
  test_heap_operations()
output: class Heap:
      def __init__(self):
          self.heap_array = []
  
      def insert(self, key):
          self.heap_array.append(key)
          self._heapify_up(len(self.heap_array) - 1)
  
      def delete(self, index):
          if len(self.heap_array) > 1:
              self.heap_array[index] = self.heap_array.pop()
              self._heapify_down(index)
          elif self.heap_array:
              self.heap_array.pop()
  
      def _heapify_up(self, index):
          parent_index = (index - 1) // 2
          if index > 0 and self.heap_array[index] > self.heap_array[parent_index]:
              self.heap_array[index], self.heap_array[parent_index] = self.heap_array[parent_index], self.heap_array[index]
              self._heapify_up(parent_index)
  
      def _heapify_down(self, index):
          largest = index
          left_child_index = 2 * index + 1
          right_child_index = 2 * index + 2
  
          if left_child_index < len(self.heap_array) and self.heap_array[left_child_index] > self.heap_array[largest]:
              largest = left_child_index
  
          if right_child_index < len(self.heap_array) and self.heap_array[right_child_index] > self.heap_array[largest]:
              largest = right_child_index
  
          if largest != index:
              self.heap_array[index], self.heap_array[largest] = self.heap_array[largest], self.heap_array[index]
              self._heapify_down(largest)