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