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
|
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()
|
||||||
|
|||||||
Reference in New Issue
Block a user