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()