예제 #1
0
def test_adding_neighbour():
    v = Vertex(1, 1)
    v.add_neighbour(2)
    v.add_neighbour(3)
    assert len(v.get_neighbours()) == 2
    assert v.get_neighbours()[0] == 2
    assert v.get_neighbours()[1] == 3
예제 #2
0
def test_cleaning_neighbours():
    v = Vertex(1, 1)
    v.add_neighbour(2)
    v.add_neighbour(3)
    v.clean_neighbours()
    assert len(v.get_neighbours()) == 0
예제 #3
0
def test_removing_neighbour():
    v = Vertex(1, 1)
    v.add_neighbour(2)
    v.add_neighbour(3)
    v.remove_neighbour(2)
    assert 2 not in v.get_neighbours()