test(cli): assert the package version, not a hardcoded literal

test_version read `assert "0.1.0" in r.stdout` and passed only because
hanzo_cli.__version__ was stale at 0.1.0 while pyproject said 0.2.2. The one
test positioned to catch the version drift was asserting the drifted value, so
single-sourcing the version in f453dae8 is what finally made it fail. It now
compares against hanzo_cli.__version__ and cannot enshrine a wrong value again.

Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
2026-07-26 14:58:15 -07:00
co-authored by Hanzo Dev
parent 6a0898b300
commit 0f9890725e
+7 -1
View File
@@ -49,8 +49,14 @@ def run(args: list[str], check: bool = True) -> subprocess.CompletedProcess:
class TestAuth:
def test_version(self):
# Assert against the package's own version, never a literal. This line
# used to read `assert "0.1.0" in r.stdout` and passed only because
# hanzo_cli.__version__ was stale at 0.1.0 while pyproject said 0.2.2 —
# the test was enshrining the drift it should have caught.
from hanzo_cli import __version__
r = run(["--version"])
assert "0.1.0" in r.stdout
assert __version__ in r.stdout
def test_help(self):
r = run(["--help"])