nix-update/tests/test_cargo_lock_update.py

43 lines
1.1 KiB
Python
Raw Normal View History

2023-03-21 16:07:26 +03:00
import subprocess
import conftest
from nix_update import main
def test_main(helpers: conftest.Helpers) -> None:
with helpers.testpkgs(init_git=True) as path:
main(
[
"--file",
str(path),
"--commit",
2023-08-06 21:40:40 +03:00
"cargoLock.update",
2023-03-21 16:07:26 +03:00
"--version",
"v0.4.7",
2023-03-21 16:07:26 +03:00
]
)
subprocess.run(
[
"nix",
"eval",
"--raw",
"--extra-experimental-features",
"nix-command",
"-f",
path,
2023-08-06 21:40:40 +03:00
"cargoLock.update.cargoDeps",
2023-03-21 16:07:26 +03:00
],
check=True,
text=True,
stdout=subprocess.PIPE,
).stdout.strip()
diff = subprocess.run(
["git", "-C", path, "show"],
text=True,
stdout=subprocess.PIPE,
check=True,
).stdout.strip()
print(diff)
assert "https://github.com/astral-sh/ruff/compare/v0.4.5...v0.4.7" in diff