def test_load_config(): conf = config.load('tests/fixtures/config.yml') assert conf == { 'db_path': 'tests/fixtures/rocketlauncher.db', 'rockets_path': 'tests/fixtures/roms', 'themes_path': 'tests/fixtures/themes', }
def test_load_config_with_invalid_file(): with pytest.raises(LoadError) as err: config.load('tests/fixtures/not_exist_config.yml') assert str(err.value) == '"tests/fixtures/not_exist_config.yml" not found'
def test_load_config_fail_when_themes_path_was_not_found(): with pytest.raises(LoadError) as err: config.load('tests/fixtures/invalid_config3.yml') assert str(err.value) == 'Config file has not "themes_path" value'
def config(): return cfg.load('tests/fixtures/config.yml')