def test_after_single_push_delete_max_removes_the_value(self): heap = MaxHeap() heap.insert(0) assert heap.size() == 1 assert not heap.is_empty() heap.delete_max() assert heap.size() == 0 assert heap.is_empty()
def test_delete_max_of_empty_heap_raises_exception(self): heap = MaxHeap() with raises(MaxHeap.EmptyHeapException): heap.delete_max()