Ejemplo n.º 1
0
 def test_simple_parsing(self):
     flight = Flight.parse_xmlelement(etree.fromstring(self.SIMPLE_XML))
     self.assertEqual("LN-KKA", flight.tail_number)
     self.assertEqual("WAW", flight.takeoff_airport.code)
     self.assertEqual("IATA", flight.takeoff_airport.type)
     self.assertEqual("EGLL", flight.landing_airport.code)
     self.assertEqual("ICAO", flight.landing_airport.type)
     self.assertEqual(iso8601.parse_date("2001-10-26T21:32:52z"), flight.takeoff_datetime)
Ejemplo n.º 2
0
 def test_simple_parsing(self):
     flight = Flight.parse_xmlelement(etree.fromstring(self.SIMPLE_XML))
     self.assertEqual("LN-KKA", flight.tail_number)
     self.assertEqual("WAW", flight.takeoff_airport.code)
     self.assertEqual("IATA", flight.takeoff_airport.type)
     self.assertEqual("EGLL", flight.landing_airport.code)
     self.assertEqual("ICAO", flight.landing_airport.type)
     self.assertEqual(iso8601.parse_date("2001-10-26T21:32:52z"), flight.takeoff_datetime)
Ejemplo n.º 3
0
 def test_required_only(self):
     ops = Ops.parsexml(XML_REQUIRED_ONLY, Schema)
     self.assertEqual("N608WB", ops.aircraft)
     self.assertEqual("123123", ops.flight_number)
     self.assertEqual("COMMERCIAL", ops.type)
     self.assertEqual("ICAO", ops.takeoff_airport.code_type)
     self.assertEqual("EGLL", ops.takeoff_airport.code)
     self.assertEqual(None, ops.takeoff_pilot)
     self.assertEqual(iso8601.parse_date("2009-12-30T23:35:59Z"), ops.landing_gate_datetime)