Files
lix/tests/functional2/config/test_config_show.py
T
rootile 25f53b755c tests: migrate config.sh
Change-Id: Ia37a84e0036dd52af112a359817c709a15aa8c90
2026-07-15 10:53:10 +00:00

32 lines
1.1 KiB
Python

from testlib.fixtures.nix import Nix
import pytest
pytestmark = pytest.mark.no_daemon
def test_config_env_var(nix: Nix):
nix.settings.disabled = True
nix.env["NIX_CONFIG"] = "cores = 4242\nexperimental-features = nix-command flakes"
res = nix.nix(["config", "show"]).run().ok()
assert "cores = 4242" in res.stdout_plain
assert "experimental-features = flakes nix-command" in res.stdout_plain
def test_config_show_single_value(nix: Nix):
res = nix.nix(["config", "show", "warn-dirty"], flake=True).run().ok()
assert res.stdout_plain == "true"
def test_trusted_user_ignored(nix: Nix):
"""
regression test for https://git.lix.systems/lix-project/lix/issues/1183
"""
nix.settings.disabled = True
nix.env["NIX_CONFIG"] = "experimental-features = nix-command\ntrusted-users = as-configured"
res = nix.nix(["config", "show", "trusted-users"]).run().ok()
assert res.stdout_plain == "as-configured"
nix.env["NIX_CONFIG"] += "\nextra-trusted-users = extra"
res = nix.nix(["config", "show", "trusted-users"]).run().ok()
assert res.stdout_plain == "as-configured extra"