nix-update/tests/test_cargo_lock_update.py
Mario Rodas 5bfdcbecf4 Fix test_cargo_lock_update
test_cargo_lock_update was relying in Ruff 0.0.254 which used its own
fork of LibCST.
Ruff deprecated its fork [1] and removed the repository, hence this
tests was failing trying to reach a defunct repository.

[1] https://github.com/astral-sh/ruff/commit/072358e26
2024-06-06 12:16:45 +00:00

43 lines
1.1 KiB
Python

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",
"cargoLock.update",
"--version",
"v0.4.7",
]
)
subprocess.run(
[
"nix",
"eval",
"--raw",
"--extra-experimental-features",
"nix-command",
"-f",
path,
"cargoLock.update.cargoDeps",
],
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