Add test files
This commit is contained in:
46
tests/test_integration.py
Normal file
46
tests/test_integration.py
Normal file
@@ -0,0 +1,46 @@
|
||||
"""Integration tests for ShellGenius."""
|
||||
|
||||
import pytest
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
|
||||
class TestIntegration:
|
||||
def test_cli_commands_registered(self):
|
||||
"""Test that all CLI commands are registered."""
|
||||
from shellgenius.cli import main
|
||||
|
||||
commands = [cmd.name for cmd in main.commands]
|
||||
|
||||
assert "generate" in commands
|
||||
assert "explain" in commands
|
||||
assert "refactor" in commands
|
||||
assert "history" in commands
|
||||
assert "models" in commands
|
||||
assert "check" in commands
|
||||
assert "version" in commands
|
||||
|
||||
def test_module_imports(self):
|
||||
"""Test that all modules can be imported."""
|
||||
from shellgenius import __version__
|
||||
from shellgenius.cli import main
|
||||
from shellgenius.config import Config
|
||||
from shellgenius.generation import ShellGenerator
|
||||
from shellgenius.explainer import ShellExplainer
|
||||
from shellgenius.refactoring import RefactoringAnalyzer
|
||||
from shellgenius.history import HistoryLearner
|
||||
from shellgenius.ollama_client import OllamaClient
|
||||
|
||||
assert __version__ == "0.1.0"
|
||||
|
||||
def test_package_structure(self):
|
||||
"""Test that package structure is correct."""
|
||||
import shellgenius
|
||||
|
||||
assert hasattr(shellgenius, "__version__")
|
||||
assert hasattr(shellgenius, "cli")
|
||||
assert hasattr(shellgenius, "config")
|
||||
assert hasattr(shellgenius, "generation")
|
||||
assert hasattr(shellgenius, "explainer")
|
||||
assert hasattr(shellgenius, "refactoring")
|
||||
assert hasattr(shellgenius, "history")
|
||||
assert hasattr(shellgenius, "ollama_client")
|
||||
Reference in New Issue
Block a user