예제 #1
0
 def ReadInput(self, filename):
     input = ReadFile(filename)
     n, m = [int(i) for i in input[0].split()]
     separator = input.index('-')
     down_map = self.ReadDown(n, m, input[1:separator])
     right_map = self.ReadRight(n, m, input[separator+1:])
     return n, m, down_map, right_map
 def testData3(self):
     k, text = self.ReadInput('dataset_199_6.txt')
     graph = DeBruijnGraph(k, text)
     expect = ReadFile('dataset_199_6_output.txt')
     output = self.FormatGraph(graph)
     self.assertEqual(expect, output)
 def testData2(self):
     k, text = self.ReadInput('debruijn_graph_string_input.txt')
     graph = DeBruijnGraph(k, text)
     expect = ReadFile('debruijn_graph_string_output.txt')
     output = self.FormatGraph(graph)
     self.assertEqual(expect, output)