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
24 lines
749 B
Python
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
|