Exemplo n.º 1
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()
Exemplo n.º 2
0
 def testAddCity(self):
     UserQueryingExpand.addCity()
     key = 'Hangzhou'
     self.assertTrue(key in QueryingData.continent)
     self.assertTrue(key in QueryingData.cityDicationary)