def test_calculate_emissions_from_flow_zero_emissions(): dict_asset = {TOTAL_FLOW: {VALUE: 100}, EMISSION_FACTOR: {VALUE: 0}} E3.calculate_emissions_from_flow(dict_asset) assert ( dict_asset[TOTAL_EMISSIONS][VALUE] == 0 ), f"{TOTAL_EMISSIONS} [{UNIT_EMISSIONS}] of an asset with an emission_factor of zero should be 0, but is {dict_asset[TOTAL_EMISSIONS][VALUE]}."
def test_calculate_emissions_from_flow(): dict_asset = {TOTAL_FLOW: {VALUE: 100}, EMISSION_FACTOR: {VALUE: 0.5}} E3.calculate_emissions_from_flow(dict_asset) assert ( dict_asset[TOTAL_EMISSIONS][VALUE] == 50 ), f"{TOTAL_EMISSIONS} [{UNIT_EMISSIONS}] of an asset should be total flow times emission factor (in this case: 100*0.5=50), but is {dict_asset[TOTAL_EMISSIONS][VALUE]}."