예제 #1
0
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',
    }
예제 #2
0
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'
예제 #3
0
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'
예제 #4
0
def config():
    return cfg.load('tests/fixtures/config.yml')