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")
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")
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")
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)
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."""
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)
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) == {}
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."""
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")
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")