test_vars_deployment: set hostPlatform depending on current system
This commit is contained in:
24
pkgs/clan-cli/tests/nix_config.py
Normal file
24
pkgs/clan-cli/tests/nix_config.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import json
|
||||
import subprocess
|
||||
from dataclasses import dataclass
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@dataclass
|
||||
class ConfigItem:
|
||||
aliases: list[str]
|
||||
defaultValue: bool # noqa: N815
|
||||
description: str
|
||||
documentDefault: bool # noqa: N815
|
||||
experimentalFeature: str # noqa: N815
|
||||
value: str | bool | list[str] | dict[str, str]
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def nix_config() -> dict[str, ConfigItem]:
|
||||
proc = subprocess.run(
|
||||
["nix", "show-config", "--json"], check=True, stdout=subprocess.PIPE
|
||||
)
|
||||
data = json.loads(proc.stdout)
|
||||
return {name: ConfigItem(**c) for name, c in data.items()}
|
||||
Reference in New Issue
Block a user