def test_cheapestRoute(self): trip = ['DUB', 'BVA', 'GDN', 'MSQ', 'DUB'] planes = dit_planes.Planes() currency = dit_currency_rates.CurrencyRate() airport = dit_airport.Airport() country = dit_country.Country() self.__app = dit_app.App(airport, country, currency, planes) self.__app.calculate(trip) cheapestRoute = self.__app.getCheapestRoute() longestSingleTrip = self.__app.getLongestSingleTrip() self.assertEqual(5, len(cheapestRoute))
def main(): planes = dit_planes.Planes() currency = dit_currency_rates.CurrencyRate() airport = dit_airport.Airport() country = dit_country.Country() # pass all objects to app app = dit_app.App(airport, country, currency, planes) # TK initialization root = Tk() root.title('DIT Flight 1.0') root.resizable(width=False, height=False) root.geometry('600x600') photo = PhotoImage(file="img/toporny.png") label1 = Label(image=photo) label1.place(x=15, y=10) # launch the app app = dit_app_form.ditForm(root, app) root.mainloop()
def test_airPortLongtitude(self): airp = dit_airport.Airport() lat = airp.getAirporttLongtitude('DUB') expected_result = '-6.270075' self.assertEqual(lat, expected_result)
def test_airPortLatitude(self): airp = dit_airport.Airport() lat = airp.getAirportLatitude('DUB') expected_result = '53.421333' self.assertEqual(lat, expected_result)
def test_airport_not_exist(self): airp = dit_airport.Airport() self.assertFalse(airp.airportExist('XXX'))
def test_airport_exist(self): airp = dit_airport.Airport() self.assertTrue(airp.airportExist('DUB'))