add clan_flake fixture to setup a temporary clan
This commit is contained in:
17
pkgs/clan-cli/tests/clan_flake.py
Normal file
17
pkgs/clan-cli/tests/clan_flake.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from pathlib import Path
|
||||
from typing import Iterator
|
||||
|
||||
import pytest
|
||||
from environment import mock_env
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def clan_flake(
|
||||
temporary_directory: Path, monkeypatch: pytest.MonkeyPatch
|
||||
) -> Iterator[Path]:
|
||||
flake = temporary_directory / "clan-flake"
|
||||
flake.mkdir()
|
||||
(flake / ".clan-flake").touch()
|
||||
monkeypatch.chdir(flake)
|
||||
with mock_env(HOME=str(temporary_directory)):
|
||||
yield temporary_directory
|
||||
@@ -3,4 +3,4 @@ import sys
|
||||
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), "helpers"))
|
||||
|
||||
pytest_plugins = ["temporary_dir"]
|
||||
pytest_plugins = ["temporary_dir", "clan_flake"]
|
||||
|
||||
Reference in New Issue
Block a user