import yaml


def mock_hookenv_config(monkeypatch):
    """Mock the hookenv config helper."""

    def mock_config():
        cfg = {}
        yml = yaml.safe_load(open("./config.yaml"))

        # Load all defaults
        for key, value in yml["options"].items():
            cfg[key] = value["default"]

        # Manually add cfg from other layers
        # cfg['my-other-layer'] = 'mock'
        return cfg

    monkeypatch.setattr("charms.layer.git_deploy.config", mock_config)