mirror of
https://github.com/Mic92/nix-update.git
synced 2024-09-11 02:25:32 +03:00
35 lines
976 B
Python
35 lines
976 B
Python
import subprocess
|
|
|
|
import conftest
|
|
|
|
from nix_update.options import Options
|
|
from nix_update.update import update
|
|
from nix_update.version.version import VersionPreference
|
|
|
|
|
|
def test_update(helpers: conftest.Helpers) -> None:
|
|
with helpers.testpkgs() as path:
|
|
opts = Options(
|
|
attribute="composer",
|
|
import_path=str(path),
|
|
# For 0.14.0 we get inconsistent lock file errors
|
|
version="0.13.1",
|
|
version_preference=VersionPreference.FIXED,
|
|
)
|
|
update(opts)
|
|
version = subprocess.run(
|
|
[
|
|
"nix",
|
|
"eval",
|
|
"--raw",
|
|
"--extra-experimental-features",
|
|
"nix-command",
|
|
"-f",
|
|
path,
|
|
"composer.version",
|
|
],
|
|
text=True,
|
|
stdout=subprocess.PIPE,
|
|
).stdout.strip()
|
|
assert tuple(map(int, version.split("."))) >= (0, 11, 1)
|