standard-tests[minor]: Add standard tests for cache (#23357)

Add standard tests for cache abstraction
This commit is contained in:
Eugene Yurtsev
2024-06-24 11:15:03 -04:00
committed by GitHub
parent 987099cfcd
commit d90379210a
4 changed files with 253 additions and 3 deletions

View 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()