tests: remove pyfakefs due to issues with pathlib and sqlite in favor of a simple tempfolder where to store test files

This commit is contained in:
cătălin 2023-11-29 18:42:30 +01:00
commit c6d361f649
Signed by: catalin
GPG key ID: 0178DF42F43E5FD2
6 changed files with 45 additions and 29 deletions

View file

@ -20,17 +20,12 @@ def test_load_from_file(notebooks_path: Path, settings_file_path: Path):
assert settings.notebooks_root_path == notebooks_path
def test_load_from_existing_standard_file(settings_file_path: Path, settings: Settings):
standard_settings = load_from_file()
assert standard_settings.notebooks_root_path == settings.notebooks_root_path
def test_load_from_empty_file_raises_value_error(empty_file_path: Path):
with pytest.raises(ValueError, match=f"File {empty_file_path} is empty"):
load_from_file(empty_file_path)
def test_load_from_non_existing_file_path_raises_file_not_found_error(halig_path: Path):
file = halig_path / "some_invalid_file.yml"
def test_load_from_non_existing_file_path_raises_file_not_found_error(halig_config_path: Path):
file = halig_config_path / "some_invalid_file.yml"
with pytest.raises(FileNotFoundError, match=f"File {file} does not exist"):
load_from_file(file)