Files
service-aware-frontend/pkgs/clan-cli/tests/clan_flake.py
2023-08-26 11:45:09 +02:00

24 lines
520 B
Python

from pathlib import Path
from typing import Iterator
import pytest
@pytest.fixture
def clan_flake(temporary_dir: Path, monkeypatch: pytest.MonkeyPatch) -> Iterator[Path]:
flake = temporary_dir / "clan-flake"
flake.mkdir()
(flake / ".clan-flake").touch()
(flake / "flake.nix").write_text(
"""
{
description = "A flake for testing clan";
inputs = {};
outputs = { self }: {};
}
"""
)
monkeypatch.chdir(flake)
monkeypatch.setenv("HOME", str(temporary_dir))
yield flake