mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-06 21:43:44 +00:00
add embeddings integration tests (#25508)
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
from abc import abstractmethod
|
||||
from typing import Type
|
||||
|
||||
import pytest
|
||||
from langchain_core.embeddings import Embeddings
|
||||
|
||||
from langchain_standard_tests.base import BaseStandardTests
|
||||
|
||||
|
||||
class EmbeddingsTests(BaseStandardTests):
|
||||
@property
|
||||
@abstractmethod
|
||||
def embeddings_class(self) -> Type[Embeddings]:
|
||||
...
|
||||
|
||||
@property
|
||||
def embedding_model_params(self) -> dict:
|
||||
return {}
|
||||
|
||||
@pytest.fixture
|
||||
def model(self) -> Embeddings:
|
||||
return self.embeddings_class(**self.embedding_model_params)
|
||||
|
||||
|
||||
class EmbeddingsUnitTests(EmbeddingsTests):
|
||||
def test_init(self) -> None:
|
||||
model = self.embeddings_class(**self.embedding_model_params)
|
||||
assert model is not None
|
Reference in New Issue
Block a user