test: add config_with_tmp_path fixture
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
from pathlib import Path
|
||||
from typing import Iterable, Callable
|
||||
|
||||
import pytest
|
||||
|
||||
from skywipe.configure import Configuration
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
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))
|
||||
|
||||
return _set
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def config_with_tmp_path(monkeypatch, tmp_path):
|
||||
monkeypatch.setattr(Path, "home", lambda: tmp_path)
|
||||
return Configuration()
|
||||
|
||||
Reference in New Issue
Block a user