Exemplo n.º 1
0
def test_cylc_site_conf_path_env_var(
    monkeypatch: Fixture,
    conf_env: Fixture,
    capload: Fixture,
    dummy_version_hierarchy: Fixture,
    conf_path: Optional[str],
    site_conf_path: Optional[str],
    files: List[str],
):
    """Test that the right files are loaded according to env vars."""
    # set the relevant environment variables
    conf_env('CYLC_CONF_PATH', conf_path)
    conf_env('CYLC_SITE_CONF_PATH', site_conf_path)

    # load the global config
    GlobalConfig.get_inst()

    assert capload == files
Exemplo n.º 2
0
def glbl_cfg(cached=True):
    """Load and return the global configuration singleton instance."""
    from cylc.flow.cfgspec.globalcfg import GlobalConfig
    return GlobalConfig.get_inst(cached=cached)
Exemplo n.º 3
0
def fake_global_conf(tmp_path):
    glblcfg = GlobalConfig(SPEC)
    (tmp_path / 'global.cylc').write_text(TEST_CONF)
    glblcfg.loadcfg(tmp_path / 'global.cylc')
    return glblcfg
Exemplo n.º 4
0
def glbl_cfg(cached=True):
    """Load and return the global configuration singleton instance."""
    from cylc.flow.cfgspec.globalcfg import GlobalConfig
    return GlobalConfig.get_inst(cached=cached)