def adding_assets_to_energysystem_model(dict_values, dict_model, model,
                                            **kwargs):
        """

        Parameters
        ----------
        dict_values: dict
            dict of simulation data

        dict_model:
            Updated list of assets in the oemof energy system model

        model: oemof.solph.network.EnergySystem
            Model of oemof energy system

        Returns
        -------

        """
        logging.info("Adding components to oemof energy system model...")

        # Busses have to be defined first
        for bus in dict_values[ENERGY_BUSSES]:
            D1.bus(model, dict_values[ENERGY_BUSSES][bus][LABEL], **dict_model)

        # Adding step by step all assets defined within the asset groups
        for asset_group in ACCEPTED_ASSETS_FOR_ASSET_GROUPS:
            if asset_group in dict_values:
                for asset in dict_values[asset_group]:
                    type = dict_values[asset_group][asset][OEMOF_ASSET_TYPE]
                    # Checking if the asset type is one accepted for the asset group (security measure)
                    if type in ACCEPTED_ASSETS_FOR_ASSET_GROUPS[asset_group]:
                        # if so, then the appropriate function of D1 should be called
                        if type == OEMOF_TRANSFORMER:
                            D1.transformer(model,
                                           dict_values[asset_group][asset],
                                           **dict_model)
                        elif type == OEMOF_SINK:
                            D1.sink(model, dict_values[asset_group][asset],
                                    **dict_model)
                        elif type == OEMOF_SOURCE:
                            D1.source(model, dict_values[asset_group][asset],
                                      **dict_model)
                        elif type == OEMOF_GEN_STORAGE:
                            D1.storage(model, dict_values[asset_group][asset],
                                       **dict_model)
                        else:
                            raise UnknownOemofAssetType(
                                f"Asset {asset} has type {type}, "
                                f"but this type is not a defined oemof asset type."
                            )

                    else:
                        raise WrongOemofAssetForGroupError(
                            f"Asset {asset} has type {type}, "
                            f"but this type is not an asset type attributed to asset group {asset_group}"
                            f" for oemof model generation.")

        logging.debug("All components added.")
        return model
    def test_bus_add_to_not_empty_dict(self):
        label = "Test bus 2"
        D1.bus(model=self.model, name=label, bus=self.busses)

        # self.model should contain the test bus
        assert self.model.entities[-1].label == label
        assert isinstance(self.model.entities[-1], solph.network.Bus)

        # self.busses should contain the test bus (key = label, value = bus object)
        assert label in self.busses
        assert isinstance(self.busses[label], solph.network.Bus)