mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-01 19:12:42 +00:00
standard-tests[patch]: Add pytest assert rewrites (#24408)
This will surface nice error messages in subclasses that fail assertions.
This commit is contained in:
@@ -1,6 +1,35 @@
|
||||
from typing import Tuple
|
||||
|
||||
import pytest
|
||||
from langchain_standard_tests.integration_tests.base_store import (
|
||||
BaseStoreAsyncTests,
|
||||
BaseStoreSyncTests,
|
||||
)
|
||||
|
||||
from langchain_core.stores import InMemoryStore
|
||||
|
||||
|
||||
# Check against standard tests
|
||||
class TestSyncInMemoryStore(BaseStoreSyncTests):
|
||||
@pytest.fixture
|
||||
def kv_store(self) -> InMemoryStore:
|
||||
return InMemoryStore()
|
||||
|
||||
@pytest.fixture
|
||||
def three_values(self) -> Tuple[str, str, str]: # type: ignore
|
||||
return "value1", "value2", "value3"
|
||||
|
||||
|
||||
class TestAsyncInMemoryStore(BaseStoreAsyncTests):
|
||||
@pytest.fixture
|
||||
async def kv_store(self) -> InMemoryStore:
|
||||
return InMemoryStore()
|
||||
|
||||
@pytest.fixture
|
||||
def three_values(self) -> Tuple[str, str, str]: # type: ignore
|
||||
return "value1", "value2", "value3"
|
||||
|
||||
|
||||
def test_mget() -> None:
|
||||
store = InMemoryStore()
|
||||
store.mset([("key1", "value1"), ("key2", "value2")])
|
||||
|
Reference in New Issue
Block a user