Merge pull request 'clan-cli/machines/list: mark test as pure' (#4761) from no-impure-machines into main

Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4761
This commit is contained in:
Mic92
2025-08-14 14:59:10 +00:00
2 changed files with 2 additions and 25 deletions

View File

@@ -125,7 +125,7 @@ def list_with_tags_multiple_tags_intersection(
assert "dev-machine" not in output.out
@pytest.mark.impure
@pytest.mark.with_core
def test_machines_list_with_tags_no_matches(
test_flake_with_core: fixtures_flakes.FlakeForTest,
capture_output: CaptureOutput,

View File

@@ -2,35 +2,12 @@ from pathlib import Path
import pytest
from clan_cli.tests.fixtures_flakes import FlakeForTest
from clan_lib.cmd import run
from clan_lib.flake import Flake
from clan_lib.nix import nix_command
from clan_lib.templates import list_templates
from clan_lib.templates.filesystem import copy_from_nixstore
@pytest.mark.impure
def test_copy_from_nixstore_symlink(
monkeypatch: pytest.MonkeyPatch, temporary_home: Path
) -> None:
src = temporary_home / "src"
src.mkdir()
(src / "file.txt").write_text("magicstring!")
res = run(nix_command(["store", "add", str(src)]))
src_nix = Path(res.stdout.strip())
src2 = temporary_home / "src2"
src2.mkdir()
(src2 / "file.txt").symlink_to(src_nix / "file.txt")
res = run(nix_command(["store", "add", str(src2)]))
src2_nix = Path(res.stdout.strip())
dest = temporary_home / "dest"
copy_from_nixstore(src2_nix, dest)
assert (dest / "file.txt").exists()
assert (dest / "file.txt").read_text() == "magicstring!"
assert (dest / "file.txt").is_symlink()
@pytest.mark.impure
@pytest.mark.with_core
def test_clan_core_templates(
test_flake_with_core: FlakeForTest,
monkeypatch: pytest.MonkeyPatch,