예제 #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
예제 #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)
예제 #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
예제 #4
0
파일: glbl_cfg.py 프로젝트: cylc/cylc
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)