test: add config_with_tmp_path fixture

This commit is contained in:
2025-12-30 23:08:51 +01:00
parent ce2a1ad594
commit 82b99da50d

View File

@@ -1,7 +1,10 @@
from pathlib import Path
from typing import Iterable, Callable from typing import Iterable, Callable
import pytest import pytest
from skywipe.configure import Configuration
@pytest.fixture @pytest.fixture
def user_input(monkeypatch) -> Callable[[Iterable[str], Iterable[str]], None]: def user_input(monkeypatch) -> Callable[[Iterable[str], Iterable[str]], None]:
@@ -14,3 +17,9 @@ def user_input(monkeypatch) -> Callable[[Iterable[str], Iterable[str]], None]:
lambda _prompt: next(password_iter)) lambda _prompt: next(password_iter))
return _set return _set
@pytest.fixture
def config_with_tmp_path(monkeypatch, tmp_path):
monkeypatch.setattr(Path, "home", lambda: tmp_path)
return Configuration()