def test_derive(self): landing_fuel = LandingFuel() landing_fuel.set_flight_attr = Mock() # Only 'AFR Takeoff Fuel' dependency. afr_landing_fuel = A('AFR Landing Fuel', value=100) landing_fuel.derive(afr_landing_fuel, None) landing_fuel.set_flight_attr.assert_called_once_with(100) # Only 'Fuel Qty At Liftoff' dependency. fuel_qty_at_touchdown = KPV('Fuel Qty At Touchdown', items=[KeyPointValue(87, 160), KeyPointValue(132, 200)]) landing_fuel.set_flight_attr = Mock() landing_fuel.derive(None, fuel_qty_at_touchdown) landing_fuel.set_flight_attr.assert_called_once_with(200) # Both, 'AFR Takeoff Fuel' used. landing_fuel.set_flight_attr = Mock() landing_fuel.derive(afr_landing_fuel, fuel_qty_at_touchdown) landing_fuel.set_flight_attr.assert_called_once_with(100)
def test_can_operate(self): self.assertEqual(LandingFuel.get_operational_combinations(), [('AFR Landing Fuel',), ('Fuel Qty At Touchdown',), ('AFR Landing Fuel', 'Fuel Qty At Touchdown')])