Example #1
0
 def testRemoveRoute(self):
     UserQueryingExpand.removeRoute()
     source = "Hong Kong"
     dest = "Shanghai"
     self.assertFalse(dest in UserQuerying.getFlyToCity(source))
     
     
     
     
     
     
     
     
     
     
     
     
     
     
Example #2
0
        cityName = raw_input("Please type querying city name: \n")
        if UserQuerying.getQueryCity(cityName) == False:
            print "Sorry, CSAir does not fly to " + cityName
        print "\n"

    elif n.strip() == "3":
        UserQuerying.getStaticalInfomation()
        print "\n"

    elif n.strip() == "4":
        cityCode = raw_input("Please type the city's code: \n")
        if UserQuerying.mapCity(cityCode.upper()) == False:
            print "Sorry, the city's code is invalid\n"

    elif n.strip() == "5":
        UserQueryingExpand.addCity()

    elif n.strip() == "6":
        UserQueryingExpand.removeCity()

    elif n.strip() == "7":
        UserQueryingExpand.addRoute()

    elif n.strip() == "8":
        UserQueryingExpand.removeRoute()

    elif n.strip() == "9":
        UserQueryingExpand.getRouteInfo()

    elif n.strip() == "10":
        UserQueryingExpand.editCity()
Example #3
0
 def testEditCity(self):
     UserQueryingExpand.editCity()
     oldName = "Champaign"
     newName = "Urbana"
     self.assertTrue(newName in QueryingData.cityDicationary)
Example #4
0
 def testRemoveCity(self):
     UserQueryingExpand.removeCity()
     key = 'Champaign'
     self.assertFalse(key in QueryingData.cityDicationary)
Example #5
0
 def testAddCity(self):
     UserQueryingExpand.addCity()
     key = 'Hangzhou'
     self.assertTrue(key in QueryingData.continent)
     self.assertTrue(key in QueryingData.cityDicationary)
Example #6
0
 def testAddRoute(self):
     UserQueryingExpand.addRoute()
     source = "Champaign"
     dest = "Shanghai"
     self.assertTrue(dest in UserQuerying.getFlyToCity(source))
Example #7
0
 def testEditCity(self):
     station1 = "Chicago"
     station2 = "Atlanta"
     station3 = "Miami"
     cost = 622
     self.assertEqual(int(UserQueryingExpand.getRouteInfo()), cost)