示例#1
0
def fetch_log_setup():
    from ..deploy.oscar.tests.session import new_test_session

    with tempfile.TemporaryDirectory() as temp_dir:
        config = io.StringIO(CONFIG.format(custom_log_dir=temp_dir))
        sess = new_test_session(default=True,
                                config=load_service_config_file(config),
                                n_cpu=8)
        with option_context({'show_progress': False}):
            try:
                yield sess
            finally:
                sess.stop_server()
示例#2
0
def test_load_service_config(cwd):
    old_cwd = os.getcwd()
    try:
        os.chdir(cwd)
        cfg = load_service_config_file(
            os.path.join(os.path.dirname(__file__), 'inherit_test_cfg2.yml'))

        assert 'services' in cfg
        assert cfg['test_list'] == ['item1', 'item2', 'item3']
        assert set(cfg['test_dict'].keys()) == {'key1', 'key2', 'key3'}
        assert set(cfg['test_dict']['key2'].values()) == {'val2_modified'}
    finally:
        os.chdir(old_cwd)