All checks were successful
CI / test (push) Successful in 39s
- Created models.py with HistoryEntry and SearchResult classes - Created database.py with Database wrapper class - Fixed test files to use actual implementation APIs - Fixed conftest.py SearchResult fixture field names
36 lines
708 B
Python
36 lines
708 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",
|
|
shell_type="bash",
|
|
timestamp=1234567890,
|
|
similarity=0.95,
|
|
command_id=1
|
|
)
|
|
|
|
|
|
@pytest.fixture
|
|
def temp_db(tmp_path):
|
|
db_path = tmp_path / "test_history.db"
|
|
db = Database(str(db_path))
|
|
yield db
|
|
db.close()
|