Add kumacli version and link it into setup.py
This commit is contained in:
31
tests/test_version.py
Normal file
31
tests/test_version.py
Normal 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
|
Reference in New Issue
Block a user