예제 #1
0
def test_error_002(settings):
    """
    conf.base_backendSettingsBackendBase: Filepath check error case 2
    (filename is a dir)
    """
    backend = SettingsBackendBase()

    with pytest.raises(SettingsBackendError):
        backend.check_filepath(settings.sample_path, filename="components")
예제 #2
0
def test_error_001(settings):
    """
    conf.base_backendSettingsBackendBase: Filepath check error case 1
    (dont exist)
    """
    backend = SettingsBackendBase()

    with pytest.raises(SettingsBackendError):
        backend.check_filepath(settings.fixtures_path, filename="dontexists")
예제 #3
0
def test_ok_002(settings):
    """conf.base_backendSettingsBackendBase: Filepath check case 2"""
    backend = SettingsBackendBase()

    result = backend.check_filepath(settings.sample_path, filename="dummy")

    assert result == os.path.join(settings.sample_path, "dummy")
예제 #4
0
def test_ok_001(settings):
    """conf.base_backendSettingsBackendBase: Filepath check case 1"""
    backend = SettingsBackendBase()

    result = backend.check_filepath(settings.fixtures_path, filename=SettingsBackendBase._default_filename)

    assert result == os.path.join(settings.fixtures_path, SettingsBackendBase._default_filename)
예제 #5
0
def test_ok_002(settings):
    """conf.base_backendSettingsBackendBase: Filepath check case 2"""
    backend = SettingsBackendBase()

    result = backend.check_filepath(settings.sample_path, filename="dummy")

    assert result == os.path.join(settings.sample_path, "dummy")
예제 #6
0
파일: 003_open.py 프로젝트: feth/boussole
def test_ok_001(settings):
    """conf.base_backend.SettingsBackendBase: Open given filepath"""
    backend = SettingsBackendBase(basedir=settings.fixtures_path)

    path, filename = backend.parse_filepath()
    filepath = backend.check_filepath(path, filename)

    assert backend.open(filepath) == """Fake settings file as SettingsBackendBase dont implement a full usable interface."""
예제 #7
0
def test_ok_001(settings):
    """conf.base_backendSettingsBackendBase: Filepath check case 1"""
    backend = SettingsBackendBase()

    result = backend.check_filepath(
        settings.fixtures_path, filename=SettingsBackendBase._default_filename)

    assert result == os.path.join(settings.fixtures_path,
                                  SettingsBackendBase._default_filename)
예제 #8
0
파일: 004_parse.py 프로젝트: feth/boussole
def test_ok_001(settings):
    """conf.base_backend.SettingsBackendBase: Dummy content parsing"""
    backend = SettingsBackendBase(basedir=settings.fixtures_path)

    path, filename = backend.parse_filepath()
    filepath = backend.check_filepath(path, filename)

    content = backend.open(filepath)

    assert backend.parse(filepath, content) == {}
예제 #9
0
파일: 003_open.py 프로젝트: feth/boussole
def test_ok_001(settings):
    """conf.base_backend.SettingsBackendBase: Open given filepath"""
    backend = SettingsBackendBase(basedir=settings.fixtures_path)

    path, filename = backend.parse_filepath()
    filepath = backend.check_filepath(path, filename)

    assert backend.open(
        filepath
    ) == """Fake settings file as SettingsBackendBase dont implement a full usable interface."""
예제 #10
0
def test_error_002(settings):
    """conf.base_backendSettingsBackendBase: Filepath check error case 2 (filename is a dir)"""
    backend = SettingsBackendBase()

    with pytest.raises(SettingsBackendError):
        backend.check_filepath(settings.sample_path, filename="components")
예제 #11
0
def test_error_001(settings):
    """conf.base_backendSettingsBackendBase: Filepath check error case 1 (dont exist)"""
    backend = SettingsBackendBase()

    with pytest.raises(SettingsBackendError):
        backend.check_filepath(settings.fixtures_path, filename="dontexists")