예제 #1
0
 def setUp(self):
     self.custom_flights = []
     self.custom_max_flights = 150
     self.custom_flight = Flight(passengers=100, max_passengers=120,
                                 from_dest='Sofia', to_dest='London',
                                 terminal=Terminal(3, 50), declined=False,
                                 start_time=Date(5, 10, 2010, hour='12:40'),
                                 end_time=Date(5, 10, 2010, hour='16:20'))
예제 #2
0
class TestTerminal(TestCase):
    def setUp(self):
        self.custom_number = 5
        self.custom_max_flights = 20
        self.terminal = Terminal(self.custom_number, self.custom_max_flights)
        self.flights = []

    def test_get_flights_for(self):
        self.custom_date = Date(29, 10, 2010, hour='22:20')
        self.assertEqual(self.terminal.get_flights_for(self.custom_date), 0)

    def test_terminal_flights_to_dest(destination):
        pass

    def test_flights_on_date_lt_hours(date, hours):
        pass

    def test_flights_within_duration(start_time, end_time):
        pass

    def test_get_flight_before(date, hour):
        pass

    def test_get_terminal_flights():
        pass

    def test_get_terminal_flights_on(date):
        pass

    def test_get_flight_from(destination):
        pass

    def test_get_flight_to(destination):
        pass

    def test_get_specific_flight_to(destination, date, hour):
        pass

    def test_get_specific_flight_from(destination, date, hour):
        pass

    def test_reservations_to_destination(destination):
        pass

    def test_passengers_to_dest(destination):
        pass

    def test_flights_with_passengers(size):
        pass

    def test_passengers_from_terminal(terminal):
        pass

    def test_passengers_reservations(flight):
        pass
예제 #3
0
 def setUp(self):
     self.custom_passengers = 100
     self.custom_max_passengers = 150
     self.custom_from_dest = 'Sofia'
     self.custom_to_dest = 'Milano'
     self.custom_terminal = Terminal(2, 30)
     self.custom_declined = False
     self.custom_start_time = Date(29, 10, 2012, hour='12:20')
     self.custom_end_time = Date(29, 10, 2012, hour='17:30')
     self.flight = Flight(self.custom_start_time,
                          self.custom_end_time, self.custom_passengers,
                          self.custom_max_passengers, self.custom_from_dest,
                          self.custom_to_dest, self.custom_terminal,
                          self.custom_declined)
예제 #4
0
 def setUp(self):
     self.custom_flight = Flight(start_time=Date(29, 10, 2010,
                                                 hour='15:15'),
                                 end_time=Date(29, 10, 2010,
                                               hour='20:30'),
                                 passengers=100, max_passengers=120,
                                 from_dest='Sofia', to_dest='Moscow',
                                 terminal=Terminal(2, 30), declined=False)
     self.custom_passenger = Passenger(first_name='Rumen',
                                       last_name='Kotsev',
                                       self.custom_flight,
                                       age=22)
     self.custom_accepted = True
     self.reservation = Reservation(custom_flight, custom_passenger,
                                    custom_accepted)
예제 #5
0
 def setUp(self):
     self.custom_first_name = "Rositsa"
     self.custom_last_name = "Zlateva"
     self.custom_flight = Flight(start_time=Date(29, 10, 2010,
                                                 hour='15:15'),
                                 end_time=Date(29, 10, 2010,
                                               hour='20:30'),
                                 passengers=100, max_passengers=120,
                                 from_dest='Sofia', to_dest='Moscow',
                                 terminal=Terminal(2, 30), declined=False)
     self.custom_age = 22
     self.passenger = Passenger(self.custom_first_name,
                                self.custom_last_name,
                                self.custom_flight,
                                self.custom_age)
예제 #6
0
 def test_flight_to_dict(self):
     self.custom_casted_result = \
         {'passengers': self.custom_flight.passengers,
          'max_passengers': self.custom_flight.max_passengers,
          'from_dest': self.custom_flight.from_dest,
          'to_dest': self.custom_flight.to_dest,
          'terminal': self.custom_flight.terminal,
          'declined': self.custom_flight.declined,
          'start_time': self.custom_flight.start_time,
          'end_time': self.custom_flight.end_time}
     self.assertEqual(self.custom_casted_result['passengers'], 100)
     self.assertEqual(self.custom_casted_result['max_passengers'], 120)
     self.assertEqual(self.custom_casted_result['from_dest'], 'Sofia')
     self.assertEqual(self.custom_casted_result['to_dest'], 'London')
     self.assertEqual(self.custom_casted_result['terminal'],
                      Terminal(3, 50))
     self.assertEqual(self.custom_casted_result['declined'], False)
     self.assertEqual(self.custom_casted_result['start_time'],
                      Date(5, 10, 2010, hour='12:40'))
     self.assertEqual(self.custom_casted_result['end_time'],
                      Date(5, 10, 2010, hour='16:20'))
예제 #7
0
 def setUp(self):
     self.custom_number = 5
     self.custom_max_flights = 20
     self.terminal = Terminal(self.custom_number, self.custom_max_flights)
     self.flights = []