Beispiel #1
0
def test_has_and_set_predecessor():
    end_v = Vertex('2')
    assert end_v.has_predecessor() is False

    start_v = Vertex('1')  # The predecessor
    end_v.set_predecessor(start_v)
    assert end_v.has_predecessor()
Beispiel #2
0
def test_get_predecessor():
    end_v = Vertex('2')
    start_v = Vertex('1')  # The predecessor
    end_v.set_predecessor(start_v)
    assert end_v.get_predecessor() == start_v