mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-16 06:53:16 +00:00
standard-tests[minor]: Add standard tests for BaseStore (#23360)
Add standard tests to base store abstraction. These only work on [str, str] right now. We'll need to check if it's possible to add encoder/decoders to generalize
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
"""Tests for the InMemoryStore class."""
|
||||
from typing import Tuple
|
||||
|
||||
import pytest
|
||||
from langchain_core.stores import InMemoryStore
|
||||
|
||||
from langchain_standard_tests.integration_tests.base_store import (
|
||||
BaseStoreAsyncTests,
|
||||
BaseStoreSyncTests,
|
||||
)
|
||||
|
||||
|
||||
class TestInMemoryStore(BaseStoreSyncTests):
|
||||
@pytest.fixture
|
||||
def three_values(self) -> Tuple[str, str, str]:
|
||||
return "foo", "bar", "buzz"
|
||||
|
||||
@pytest.fixture
|
||||
def kv_store(self) -> InMemoryStore:
|
||||
return InMemoryStore()
|
||||
|
||||
|
||||
class TestInMemoryStoreAsync(BaseStoreAsyncTests):
|
||||
@pytest.fixture
|
||||
def three_values(self) -> Tuple[str, str, str]: # type: ignore
|
||||
return "foo", "bar", "buzz"
|
||||
|
||||
@pytest.fixture
|
||||
async def kv_store(self) -> InMemoryStore:
|
||||
return InMemoryStore()
|
Reference in New Issue
Block a user