def test_getDotContent(): file = code.readFile(path) graphName, vertices, edges = code.parseGraphData(file) actual = code.getDotContent(vertices, edges) expected = "data;\n\nparam n := 6;\n\nset E := 0 1 0 2 1 2 1 4 3 2 3 5 4 5;\n\nend;" assert actual == expected
def test_parseGraphData_vertices2(): data = code.readFile(path) name, vertices, edges = code.parseGraphData(data) actual = vertices[-1] expect = "5" assert actual == expect
def test_parseGraphData_name(): data = code.readFile(path) name, vertices, edges = code.parseGraphData(data) actual = name expect = "G" assert actual == expect
def test_parseGraphData_edges2(): data = code.readFile(path) name, vertices, edges = code.parseGraphData(data) edge = next(edges) actual = edge[1] expect = "1" assert actual == expect