32 lines
1007 B
Python
32 lines
1007 B
Python
#!/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
|