Files
shell-history-semantic-search/tests/test_embeddings.py
7000pctAUTO 2424a58af9
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:45 +00:00

24 lines
749 B
Python

import pytest
from shell_history_search.embeddings import EmbeddingService
class TestEmbeddingService:
@pytest.fixture
def service(self):
return EmbeddingService()
def test_get_embedding(self, service):
embedding = service.get_embedding("test command")
assert isinstance(embedding, list)
assert len(embedding) == 384
def test_get_embedding_consistency(self, service):
emb1 = service.get_embedding("test command")
emb2 = service.get_embedding("test command")
assert emb1 == emb2
def test_get_embedding_different_commands(self, service):
emb1 = service.get_embedding("command one")
emb2 = service.get_embedding("command two")
assert emb1 != emb2