def main(): with open('input.txt', 'r') as f: data = f.read() graph = parse_graph_from_input(data) print dfs_components(graph)
def testParseGraphFromInput(self): self.assertEqual(self.graph_basic, parse_graph_from_input(self.graph_basic_data)) self.assertEqual(self.graph_weighed, parse_graph_from_input(self.graph_weighed_data))