Esempio n. 1
0
    def __manage_single_itinerary(self):
        # validate user inputs
        try:
            hubs, stopover_cost, constraints_list, home_airport, other_airports, aircraft_code = \
                validate_inputs_for_single_itinerary(self.hubs_entry.get().upper().split(),
                                self.stopover_cost_entry.get(),
                                self.constraints_entry.get().upper().split(),
                                self.home_airport_entry.get().upper(),
                                self.other_airports_entry.get().upper().split(),
                                self.aircraft_entry.get().upper())
        except TypeError:
            return

        print("Managing single itinerary...")
        manage_single_route(home_airport,
                            other_airports,
                            aircraft_code,
                            self.__exchrate,
                            self.__datetime,
                            self.__empty_tank,
                            hubs,
                            stopover_cost,
                            constraints_list,
                            self.airport_entry.get(),
                            self.aircraft_file_entry.get(),
                            self.currency_entry.get(),
                            self.exchange_rate_entry.get(),
                            self.output_entry.get())
Esempio n. 2
0
 def test_raising_ImpossibleRouteError(self):
     """
     Attempting to manage a route beyond the aircraft's range should raise an ImpossibleRouteError.
     """
     for home_airport, other_airports, aircraft_code in self.impossible_routes:
         result = manage_single_route(home_airport, other_airports, aircraft_code)
         self.assertRaises(ImpossibleRouteError)