Пример #1
0
def test_heap_color():
    h = heap.Heap()

    assert len(h.color) == 1
Пример #2
0
def test_heap_size():
    h = heap.Heap()

    assert h.size == 1
Пример #3
0
def test_heap_cost():
    h = heap.Heap()

    assert len(h.cost) == 1
Пример #4
0
def test_heap_remove():
    h = heap.Heap()

    status = h.remove()

    assert status == False
Пример #5
0
def test_heap_policy():
    h = heap.Heap()

    assert h.policy == 'min'
Пример #6
0
def test_heap_left_son():
    h = heap.Heap(size=10)

    left_son = h.left_son(5)

    assert left_son == 11
Пример #7
0
def test_heap_right_son():
    h = heap.Heap(size=10)

    right_son = h.right_son(5)

    assert right_son == 12
Пример #8
0
def test_heap_dad():
    h = heap.Heap(size=10)

    dad = h.dad(5)

    assert dad == 2
Пример #9
0
def test_heap_is_empty():
    h = heap.Heap()

    status = h.is_empty()

    assert status == True
Пример #10
0
def test_heap_last():
    h = heap.Heap()

    assert h.last == -1
Пример #11
0
def test_heap_pos():
    h = heap.Heap()

    assert len(h.pos) == 1
Пример #12
0
def test_heap_p():
    h = heap.Heap()

    assert len(h.p) == 1