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",
|
2024-06-01 07:20:00 +03:00
|
|
|
"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)
|
2024-06-01 07:20:00 +03:00
|
|
|
assert "https://github.com/astral-sh/ruff/compare/v0.4.5...v0.4.7" in diff
|