コード例 #1
0
 def test_derive(self):
     takeoff_fuel = TakeoffFuel()
     takeoff_fuel.set_flight_attr = Mock()
     # Only 'AFR Takeoff Fuel' dependency.
     afr_takeoff_fuel = A('AFR Takeoff Fuel', value=100)
     takeoff_fuel.derive(afr_takeoff_fuel, None)
     takeoff_fuel.set_flight_attr.assert_called_once_with(100)
     # Only 'Fuel Qty At Liftoff' dependency.
     fuel_qty_at_liftoff = KPV('Fuel Qty At Liftoff',
                               items=[KeyPointValue(132, 200)])
     takeoff_fuel.set_flight_attr = Mock()
     takeoff_fuel.derive(None, fuel_qty_at_liftoff)
     takeoff_fuel.set_flight_attr.assert_called_once_with(200)
     # Both, 'AFR Takeoff Fuel' used.
     takeoff_fuel.set_flight_attr = Mock()
     takeoff_fuel.derive(afr_takeoff_fuel, fuel_qty_at_liftoff)
     takeoff_fuel.set_flight_attr.assert_called_once_with(100)
コード例 #2
0
 def test_can_operate(self):
     self.assertEqual(TakeoffFuel.get_operational_combinations(),
                      [('AFR Takeoff Fuel',), ('Fuel Qty At Liftoff',),
                       ('AFR Takeoff Fuel', 'Fuel Qty At Liftoff')])