コード例 #1
0
def build_staff(html_page):
    total_pilots, busy_pilots = get_pilots(html_page)
    ready_pilots = total_pilots - busy_pilots
    total_flight_attendants, busy_flight_attendants = get_flight_attendants(html_page)
    ready_flight_attendants = total_flight_attendants - busy_flight_attendants
    # TODO fill the correct value
    total_mechanics = get_mechanics(html_page)
    return Staff(total_pilots=total_pilots, total_flight_attendants=total_flight_attendants,
                 total_mechanics=total_mechanics, ready_pilots=ready_pilots,
                 ready_flight_attendants=ready_flight_attendants)
コード例 #2
0
 def test_pilots(self):
     total_pilots, busy_pilots = get_pilots(self.__html_page)
     self.assertEqual(total_pilots, 166)
     self.assertEqual(busy_pilots, 148)