def populated_graph(): graph = wgraph.Wgraph() graph.dict = { 'a': OrderedDict([('b', 1)]), 'b': OrderedDict([('c', 2), ('d', 4)]), 'c': OrderedDict([('b', 5), ('a', 3)]), 'd': OrderedDict([('c', 6)]), 'e': OrderedDict() } return graph
def populated_graph1(): graph = wgraph.Wgraph() graph.dict = { 'a': OrderedDict([('b', 10), ('c', 1), ('e', 20)]), 'b': OrderedDict([('d', 7)]), 'c': OrderedDict([('d', 2), ('e', 8)]), 'd': OrderedDict([('e', 3)]), 'e': OrderedDict() } return graph
def populated_graph2(): graph = wgraph.Wgraph() graph.dict = { 'a': OrderedDict([('b', 4)]), 'b': OrderedDict([('c', 5), ('d', 1)]), 'c': OrderedDict([('d', 6)]), 'd': OrderedDict([('e', 7)]), 'e': OrderedDict([('f', 8)]) } return graph
def depth_populated_graph(): graph = wgraph.Wgraph() graph.dict = { 'a': OrderedDict([('b', 1), ('c', 2), ('e', 3)]), 'b': OrderedDict([('d', 4), ('f', 5)]), 'c': OrderedDict([('g', 6)]), 'd': OrderedDict(), 'e': OrderedDict(), 'f': OrderedDict([('e', 7)]), 'g': OrderedDict() } return graph
def test___init__(): """Test instantiates simple graph with dictionary.""" assert wgraph.Wgraph().dict == {}
def empty_graph(): graph = wgraph.Wgraph() return graph
def no_path_graph(): graph = wgraph.Wgraph() graph.dict = {'a': OrderedDict(), 'b': OrderedDict()} return graph