mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
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:
@@ -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"])
|
||||
|
||||
Reference in New Issue
Block a user