예제 #1
0
 def testLongestFlight(self):
     stats = query()
     longest = stats.longestFlight()
     self.assertEqual(longest,'SYD to LAX (12051)')
예제 #2
0
 def testShortestFlight(self):
     stats = query()
     shortest = stats.shortestFlight()
     self.assertEqual(shortest,'CMI to CHI (132)')
예제 #3
0
 def testSmallestCity(self):
     stats = query()
     smallest = stats.smallestCity()
     self.assertEqual(smallest,'Champaign (226000)')
예제 #4
0
 def testBiggestCity(self):
     stats = query()
     biggest = stats.biggestCity()
     self.assertEqual(biggest,'Tokyo (34000000)')
예제 #5
0
 def testAverage(self):
     stats = query()
     average = stats.averagePopulation()
     self.assertEqual(average,11560018) 
예제 #6
0
 def testMerge(self):
     stats = query()
     cityinfo = stats.cityInfo("Champaign")
     self.assertEqual(cityinfo.__contains__('Name: Champaign'),True)
예제 #7
0
 def testTotaltime(self):
     stats =query()
     clist = ['SHA','TYO','SFO']
     totaltime = stats.TotalTime(clist)
     self.assertEqual(str(totaltime), '18.8373333333')        
예제 #8
0
 def testTotalcost(self):
     stats =query()
     clist = ['SHA','TYO','SFO']
     totalcost = stats.TotalCost(clist)
     self.assertEqual(str(totalcost), '3112.5')
예제 #9
0
 def testTotaldis(self):
     stats =query()
     clist = ['SHA','TYO','SFO']
     totaldis = stats.TotalDistance(clist)
     self.assertEqual(totaldis, 10078)