예제 #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