def test_breadth_first_none():
    g = Graph()
    apple = g.add_vertex('apple')
    banana = g.add_vertex('banana')
    orange = g.add_vertex('orange')
    kiwi = g.add_vertex('kiwi')
    potato = g.add_vertex('potato')
    assert g.depth_first(banana) == ['banana']
def test_breadth_first_one():
    g = Graph()
    apple = g.add_vertex('apple')
    banana = g.add_vertex('banana')
    orange = g.add_vertex('orange')
    kiwi = g.add_vertex('kiwi')
    potato = g.add_vertex('potato')

    g.add_edge(apple, banana, 4)
    g.add_edge(apple, orange, 5)
    g.add_edge(orange, kiwi, 8)
    g.add_edge(banana, kiwi, 7)
    g.add_edge(kiwi, potato, 9)
    g.add_edge(banana, potato, 11)

    assert g.depth_first(banana) == [
        'banana', 'potato', 'kiwi', 'orange', 'apple'
    ]