Add kumacli version and link it into setup.py

This commit is contained in:
Pim van Pelt
2025-08-03 12:36:51 +02:00
parent 7eafb1e68e
commit 41692b7dc1
5 changed files with 70 additions and 4 deletions

31
tests/test_version.py Normal file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/env python3
import pytest
from unittest.mock import Mock
from kumacli.cmd.version import handle_version_command, __version__
class TestVersionCommand:
def test_handle_version_command(self, mock_client, capsys):
"""Test version command handler"""
# Setup
mock_args = Mock()
# Execute
result = handle_version_command(mock_args, mock_client)
# Verify
assert result is True
captured = capsys.readouterr()
assert f"kumacli {__version__}" in captured.out
def test_version_is_defined(self):
"""Test that version is properly defined"""
assert __version__ is not None
assert isinstance(__version__, str)
assert len(__version__) > 0
# Version should follow semantic versioning pattern (e.g., "1.4.0")
parts = __version__.split(".")
assert len(parts) >= 2 # At least major.minor
assert all(part.isdigit() for part in parts) # All parts should be numeric