Warn on an untested cv4pve-cli version at startup
CI / pytest and ruff (pull_request) Successful in 4m42s
CI / pytest and ruff (push) Has been cancelled

At startup the app runs `cv4pve-cli --version`. If it differs from
cli.TESTED_VERSION (2.4.0), a warning says which version was found
and which one was tested. The app parses output formats that are not
a stable API: the config list text, prune-backups as a JSON string,
the CT ip-addresses JSON string and the exit codes with --wait. A
newer cv4pve-cli could break them in confusing ways.

If cv4pve-cli cannot be run at all, an error says so once, instead of
every later call failing without explanation. The README notes the
tested version.

Closes #14

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit was merged in pull request #27.
This commit is contained in:
DuckbootandClaude Opus 5.5 committed 2026-11-03 00:30:14 +01:00
1 parent 364f8e2137
commit e7569a7bf7
5 files changed
+83 -1

No files matched your search

+13
View File
@@ -1375,3 +1375,16 @@ def test_package_updates_failure_raises_clierror(monkeypatch):
FakeRun(monkeypatch, "Error: node unreachable\n", returncode=1)
with pytest.raises(cli.CliError):
cli.package_updates("mainframe")
# --- #14 ----------------------------------------------------------------------------
def test_version_argv_and_strips(fake):
fake.result = ("2.4.0\n", "", 0)
assert cli.version() == "2.4.0"
assert fake.argv == ["cv4pve-cli", "--version"]
def test_tested_version_constant():
assert cli.TESTED_VERSION == "2.4.0"