Some checks failed
CI / test (push) Has been cancelled
- 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
35 lines
678 B
Python
35 lines
678 B
Python
import pytest
|
|
|
|
from shell_history_search.models import HistoryEntry, SearchResult
|
|
from shell_history_search.database import Database
|
|
|
|
|
|
@pytest.fixture
|
|
def sample_history_entry():
|
|
return HistoryEntry(
|
|
id=1,
|
|
timestamp=1234567890.0,
|
|
command="ls -la",
|
|
exit_code=0,
|
|
shell="bash",
|
|
working_dir="/home/user"
|
|
)
|
|
|
|
|
|
@pytest.fixture
|
|
def sample_search_result():
|
|
return SearchResult(
|
|
command="ls -la",
|
|
timestamp=1234567890.0,
|
|
score=0.95,
|
|
shell="bash"
|
|
)
|
|
|
|
|
|
@pytest.fixture
|
|
def temp_db(tmp_path):
|
|
db_path = tmp_path / "test_history.db"
|
|
db = Database(str(db_path))
|
|
yield db
|
|
db.close()
|