Dijkstra icon indicating copy to clipboard operation
Dijkstra copied to clipboard

leafe nodes are missing in list

Open kes31 opened this issue 1 year ago • 0 comments

from dijkstra import Graph


def test_fixed_condition_list():
    uut = Graph()
    for key, value in [
        ('external', 'stopper'),
        ('goal', 'step2'),
        ('goal', 'stopper'),
        ('step1', 'start'),
        ('step1', 'step2'),
        ('step2', 'goal'),
        ('stopper', 'external'),
        ('stopper', 'goal'),
        ('stopper', 'step1'),
    ]:
        uut.add_edge(key, value, 1)

    assert list(uut.get_nodes()) == [
        'stopper',
        'step1',
        'step2',
        'goal',
        'start',
        'external'
    ]

kes31 avatar May 12 '23 14:05 kes31