2022-11-15 01:13:11 +03:00
|
|
|
import subprocess
|
|
|
|
|
|
|
|
import conftest
|
2021-07-27 18:54:25 +03:00
|
|
|
|
|
|
|
from nix_update.options import Options
|
|
|
|
from nix_update.update import update
|
|
|
|
|
|
|
|
|
|
|
|
def test_update(helpers: conftest.Helpers) -> None:
|
|
|
|
with helpers.testpkgs() as path:
|
|
|
|
opts = Options(attribute="savanna", import_path=str(path))
|
|
|
|
update(opts)
|
|
|
|
version = subprocess.run(
|
|
|
|
[
|
|
|
|
"nix",
|
|
|
|
"eval",
|
|
|
|
"--raw",
|
2022-05-19 10:52:15 +03:00
|
|
|
"--extra-experimental-features",
|
2021-07-27 18:54:25 +03:00
|
|
|
"nix-command",
|
|
|
|
"-f",
|
|
|
|
path,
|
|
|
|
"savanna.version",
|
|
|
|
],
|
|
|
|
text=True,
|
|
|
|
stdout=subprocess.PIPE,
|
2023-04-27 06:24:38 +03:00
|
|
|
).stdout.strip()
|
|
|
|
assert tuple(map(int, version.split("."))) >= (0, 6, 8)
|