cli: rename admin create to create
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
from typing import Union
|
||||
|
||||
import pytest_subprocess.fake_process
|
||||
from cli import Cli
|
||||
from pytest_subprocess import utils
|
||||
|
||||
|
||||
# using fp fixture from pytest-subprocess
|
||||
def test_create(fp: pytest_subprocess.fake_process.FakeProcess) -> None:
|
||||
cmd: list[Union[str, utils.Any]] = ["nix", "flake", "init", "-t", fp.any()]
|
||||
fp.register(cmd)
|
||||
cli = Cli()
|
||||
cli.run(["admin", "--folder", "./my-clan", "create"])
|
||||
assert fp.call_count(cmd) == 1
|
||||
12
pkgs/clan-cli/tests/test_clan_template.py
Normal file
12
pkgs/clan-cli/tests/test_clan_template.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from cli import Cli
|
||||
|
||||
|
||||
@pytest.mark.impure
|
||||
def test_template(monkeypatch: pytest.MonkeyPatch, temporary_dir: Path) -> None:
|
||||
monkeypatch.chdir(temporary_dir)
|
||||
cli = Cli()
|
||||
cli.run(["create"])
|
||||
assert (temporary_dir / ".clan-flake").exists()
|
||||
Reference in New Issue
Block a user