def test_two_pushes_and_two_extract_max_correct_values_empty_at_end(self):
        heap = MaxHeap()
        heap.insert(0)
        heap.insert(1)

        assert heap.size() == 2
        assert not heap.is_empty()
        assert heap.extract_max() == 1
        assert heap.size() == 1
        assert not heap.is_empty()
        assert heap.extract_max() == 0
        assert heap.size() == 0
        assert heap.is_empty()
 def test_after_single_push_extract_max_removes_and_returns_value(self):
     heap = MaxHeap()
     heap.insert(0)
     assert heap.size() == 1
     assert not heap.is_empty()
     assert heap.extract_max() == 0
     assert heap.size() == 0
     assert heap.is_empty()
 def test_extract_max_of_empty_heap_raises_exception(self):
     heap = MaxHeap()
     with raises(MaxHeap.EmptyHeapException):
         heap.extract_max()