Exemplo n.º 1
0
def test_heap_color():
    h = heap.Heap()

    assert len(h.color) == 1
Exemplo n.º 2
0
def test_heap_size():
    h = heap.Heap()

    assert h.size == 1
Exemplo n.º 3
0
def test_heap_cost():
    h = heap.Heap()

    assert len(h.cost) == 1
Exemplo n.º 4
0
def test_heap_remove():
    h = heap.Heap()

    status = h.remove()

    assert status == False
Exemplo n.º 5
0
def test_heap_policy():
    h = heap.Heap()

    assert h.policy == 'min'
Exemplo n.º 6
0
def test_heap_left_son():
    h = heap.Heap(size=10)

    left_son = h.left_son(5)

    assert left_son == 11
Exemplo n.º 7
0
def test_heap_right_son():
    h = heap.Heap(size=10)

    right_son = h.right_son(5)

    assert right_son == 12
Exemplo n.º 8
0
def test_heap_dad():
    h = heap.Heap(size=10)

    dad = h.dad(5)

    assert dad == 2
Exemplo n.º 9
0
def test_heap_is_empty():
    h = heap.Heap()

    status = h.is_empty()

    assert status == True
Exemplo n.º 10
0
def test_heap_last():
    h = heap.Heap()

    assert h.last == -1
Exemplo n.º 11
0
def test_heap_pos():
    h = heap.Heap()

    assert len(h.pos) == 1
Exemplo n.º 12
0
def test_heap_p():
    h = heap.Heap()

    assert len(h.p) == 1