def test_evaluate_lifetime_costs(): settings = {EVALUATED_PERIOD: {VALUE: 10}} economic_data = { PROJECT_DURATION: { VALUE: 20 }, DISCOUNTFACTOR: { VALUE: 0.1 }, TAX: { VALUE: 0 }, CRF: { VALUE: 0.1 }, ANNUITY_FACTOR: { VALUE: 7 }, } dict_asset = { SPECIFIC_COSTS_OM: { VALUE: 5, UNIT: "unit" }, SPECIFIC_COSTS: { VALUE: 100, UNIT: "unit" }, DISPATCH_PRICE: { VALUE: 1, UNIT: "unit" }, LIFETIME: { VALUE: 10 }, UNIT: UNIT, AGE_INSTALLED: { VALUE: 0 }, } C0.evaluate_lifetime_costs(settings, economic_data, dict_asset) # Note: Only the relevant keys are tested here. The valid calculation of the costs is tested with test_benchmark_KPI.py, Test_Economic_KPI.test_benchmark_Economic_KPI_C2_E2() for k in [ LIFETIME_SPECIFIC_COST, LIFETIME_SPECIFIC_COST_OM, ANNUITY_SPECIFIC_INVESTMENT_AND_OM, SIMULATION_ANNUITY, LIFETIME_PRICE_DISPATCH, SPECIFIC_REPLACEMENT_COSTS_INSTALLED, SPECIFIC_REPLACEMENT_COSTS_OPTIMIZED, ]: assert k in dict_asset, f"Function does not add {k} to the asset dictionary."
def test_evaluate_lifetime_costs_adds_all_parameters(): C0.evaluate_lifetime_costs(settings, economic_data, dict_asset) for k in ( LIFETIME_SPECIFIC_COST, ANNUITY_SPECIFIC_INVESTMENT_AND_OM, LIFETIME_SPECIFIC_COST_OM, LIFETIME_PRICE_DISPATCH, SIMULATION_ANNUITY, SPECIFIC_REPLACEMENT_COSTS_OPTIMIZED, SPECIFIC_REPLACEMENT_COSTS_INSTALLED, ): assert (k in dict_asset.keys() ), f"Function does not add {k} to the asset dictionary."