tests: Add a yaml_config_stub fixture

This commit is contained in:
Florian Bruhin 2018-03-12 07:39:20 +01:00
parent d72691ee49
commit c03ef10d54

View File

@ -193,11 +193,15 @@ def configdata_init():
@pytest.fixture
def config_stub(stubs, monkeypatch, configdata_init, config_tmpdir):
"""Fixture which provides a fake config object."""
yaml_config = configfiles.YamlConfig()
def yaml_config_stub(config_tmpdir):
"""Fixture which provides a YamlConfig object."""
return configfiles.YamlConfig()
conf = config.Config(yaml_config=yaml_config)
@pytest.fixture
def config_stub(stubs, monkeypatch, configdata_init, yaml_config_stub):
"""Fixture which provides a fake config object."""
conf = config.Config(yaml_config=yaml_config_stub)
monkeypatch.setattr(config, 'instance', conf)
container = config.ConfigContainer(conf)