pkgs/clan/cli: Add test for builtin flakeref

This commit is contained in:
a-kenji
2025-07-29 12:48:26 +02:00
parent 0a43721a45
commit 3ef6b2f715

View File

@@ -150,3 +150,21 @@ def test_create_flake_fallback_from_non_clan_directory(
)
assert (new_clan_dir / "flake.nix").exists()
@pytest.mark.with_core
def test_create_flake_with_local_template_reference(
monkeypatch: pytest.MonkeyPatch,
temporary_home: Path,
test_flake: FlakeForTest,
) -> None:
monkeypatch.chdir(test_flake.path)
new_clan_dir = temporary_home / "new-clan"
monkeypatch.setenv("LOGNAME", "testuser")
# TODO: should error with: localFlake does not export myLocalTemplate clan template
cli.run(
["flakes", "create", str(new_clan_dir), "--template=.#default", "--no-update"]
)
assert (new_clan_dir / "flake.nix").exists()