2023-12-09 17:07:39 +03:00
|
|
|
import subprocess
|
|
|
|
|
|
|
|
import conftest
|
|
|
|
|
|
|
|
from nix_update.options import Options
|
|
|
|
from nix_update.update import update
|
2024-03-18 10:09:50 +03:00
|
|
|
from nix_update.version.version import VersionPreference
|
2023-12-09 17:07:39 +03:00
|
|
|
|
|
|
|
|
|
|
|
def test_update(helpers: conftest.Helpers) -> None:
|
|
|
|
with helpers.testpkgs() as path:
|
2024-03-18 10:09:50 +03:00
|
|
|
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,
|
|
|
|
)
|
2023-12-09 17:07:39 +03:00
|
|
|
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)
|