Пример #1
0
 def testMapOutput(self):
     """generates some files and checks if they have the right size"""
     for n in range(2,100):
         gen_input.generate(n, 10, 5, (open("stradario.txt", "w"), open("percorso.txt", "w")))
         currLen = len(open("stradario.txt").read().split('.')) - 1
         shouldLen = 1 + n + (n * n)
         self.assertEqual(currLen, shouldLen)
Пример #2
0
 def testPathOutput(self):
     """Checks the right length of the path"""
     for l in range(1,100):
         gen_input.generate(10, l, 5, (open("stradario.txt", "w"), open("percorso.txt", "w")))
         currLen = len(open("percorso.txt").read().split('.')) - 1
         self.assertEqual(l, currLen)