Files
shell-history-semantic-search/tests/test_cli.py
7000pctAUTO c583999156
Some checks failed
CI / test (push) Has been cancelled
fix: resolve CI test failures by removing unused imports and updating workflow paths
- Removed unused imports from test files (os, pytest, pathlib.Path, MagicMock, patch, numpy, sqlite3, IndexingService)
- Updated CI workflow to only check shell-history-semantic-search project files instead of all files in shared src/ and tests/ directories
- All 43 tests pass locally
2026-03-22 18:24:44 +00:00

32 lines
973 B
Python

import pytest
from unittest.mock import patch, MagicMock
from click.testing import CliRunner
from shell_history_search.cli import cli
class TestCLI:
@pytest.fixture
def runner(self):
return CliRunner()
@pytest.fixture
def mock_search(self):
with patch('shell_history_search.cli.search_shell_history') as mock:
yield mock
def test_cli_basic(self, runner, mock_search):
mock_search.return_value = []
result = runner.invoke(cli, ['--query', 'test'])
assert result.exit_code == 0
def test_cli_with_limit(self, runner, mock_search):
mock_search.return_value = []
result = runner.invoke(cli, ['--query', 'test', '--limit', '5'])
assert result.exit_code == 0
def test_cli_with_shell_filter(self, runner, mock_search):
mock_search.return_value = []
result = runner.invoke(cli, ['--query', 'test', '--shell', 'bash'])
assert result.exit_code == 0