Files
lix/tests/functional2/flakes/test_subdir_flake.py
T
eldritch horrors b1776ce4e2 testing: migrates flakes/subdir-flake.sh
Change-Id: I9ac02056d490473dd751f7ec7857840290f5afc5
2026-02-17 17:22:23 +01:00

25 lines
894 B
Python

from fnmatch import fnmatch
from testlib.fixtures.git import Git
from testlib.fixtures.nix import Nix
from testlib.fixtures.file_helper import with_files
from testlib.utils import get_global_asset_pack
from pathlib import Path
from .common import simple_flake
@with_files({"flake-container": get_global_asset_pack(".git") | {"flake-dir": simple_flake()}})
def test_subdir_flake(nix: Nix, files: Path, git: Git):
container = files / "flake-container"
flake = container / "flake-dir"
nix.settings.add_xp_feature("nix-command", "flakes")
git(container, "add", "flake-dir")
info = nix.nix(["flake", "info", "--json"], cwd=flake).run().json()
assert fnmatch(info["resolvedUrl"], "git+file://*/flake-container[?]dir=flake-dir")
assert fnmatch(info["url"], "git+file://*/flake-container[?]dir=flake-dir")
nix.nix(["build", f"path:{flake}#foo", "-L"]).run().ok()