@pytest.fixture
def file_config_mock(request):
    '\n    Fixture which allows to have an isolated in-memory configuration file instance which\n    is not persisted after exiting the fixture.\n\n    This override works only in tests which use config calls directly, not in the ones working\n    via the API, as the server config is not changed.\n    '
    from unittest import mock
    from rucio.common.config import Config, config_set, config_has_section, config_add_section
    overrides = []
    params = __get_fixture_param(request)
    if params:
        overrides = params.get('overrides', overrides)
    parser = Config().parser
    with mock.patch('rucio.common.config.get_config', side_effect=(lambda : parser)):
        for (section, option, value) in (overrides or []):
            if (not config_has_section(section)):
                config_add_section(section)
            config_set(section, option, value)
        (yield)
Fixture which allows to have an isolated in-memory configuration file instance which
is not persisted after exiting the fixture.

This override works only in tests which use config calls directly, not in the ones working
via the API, as the server config is not changed.
@pytest.fixture
def file_config_mock(request):
    '\n    Fixture which allows to have an isolated in-memory configuration file instance which\n    is not persisted after exiting the fixture.\n\n    This override works only in tests which use config calls directly, not in the ones working\n    via the API, as the server config is not changed.\n    '
    from unittest import mock
    from rucio.common.config import Config, config_set, config_has_section, config_add_section
    overrides = []
    params = __get_fixture_param(request)
    if params:
        overrides = params.get('overrides', overrides)
    parser = Config().parser
    with mock.patch('rucio.common.config.get_config', side_effect=(lambda : parser)):
        for (section, option, value) in (overrides or []):
            if (not config_has_section(section)):
                config_add_section(section)
            config_set(section, option, value)
        (yield)