mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-16 23:13:31 +00:00
standard-tests[minor]: Add standard tests for cache (#23357)
Add standard tests for cache abstraction
This commit is contained in:
19
libs/standard-tests/tests/unit_tests/test_in_memory_cache.py
Normal file
19
libs/standard-tests/tests/unit_tests/test_in_memory_cache.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import pytest
|
||||
from langchain_core.caches import InMemoryCache
|
||||
|
||||
from langchain_standard_tests.integration_tests.cache import (
|
||||
AsyncCacheTestSuite,
|
||||
SyncCacheTestSuite,
|
||||
)
|
||||
|
||||
|
||||
class TestInMemoryCache(SyncCacheTestSuite):
|
||||
@pytest.fixture
|
||||
def cache(self) -> InMemoryCache:
|
||||
return InMemoryCache()
|
||||
|
||||
|
||||
class TestInMemoryCacheAsync(AsyncCacheTestSuite):
|
||||
@pytest.fixture
|
||||
async def cache(self) -> InMemoryCache:
|
||||
return InMemoryCache()
|
Reference in New Issue
Block a user