test_in_memory.py — langchain Source File
Architecture documentation for test_in_memory.py, a python file in the langchain codebase. 5 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 18a70a30_3cd9_bf6b_3c2f_3319b135a50a["test_in_memory.py"] 8e2034b7_ceb8_963f_29fc_2ea6b50ef9b3["typing"] 18a70a30_3cd9_bf6b_3c2f_3319b135a50a --> 8e2034b7_ceb8_963f_29fc_2ea6b50ef9b3 120e2591_3e15_b895_72b6_cb26195e40a6["pytest"] 18a70a30_3cd9_bf6b_3c2f_3319b135a50a --> 120e2591_3e15_b895_72b6_cb26195e40a6 ffeebd9e_f9ec_fa09_7b49_11ea418a69ca["langchain_tests.integration_tests.base_store"] 18a70a30_3cd9_bf6b_3c2f_3319b135a50a --> ffeebd9e_f9ec_fa09_7b49_11ea418a69ca 91721f45_4909_e489_8c1f_084f8bd87145["typing_extensions"] 18a70a30_3cd9_bf6b_3c2f_3319b135a50a --> 91721f45_4909_e489_8c1f_084f8bd87145 cf23aed0_f3dd_3cba_61aa_c00a3e5a1b92["langchain_core.stores"] 18a70a30_3cd9_bf6b_3c2f_3319b135a50a --> cf23aed0_f3dd_3cba_61aa_c00a3e5a1b92 style 18a70a30_3cd9_bf6b_3c2f_3319b135a50a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
from typing import Any
import pytest
from langchain_tests.integration_tests.base_store import (
BaseStoreAsyncTests,
BaseStoreSyncTests,
)
from typing_extensions import override
from langchain_core.stores import InMemoryStore
# Check against standard tests
class TestSyncInMemoryStore(BaseStoreSyncTests[Any]):
@pytest.fixture
@override
def kv_store(self) -> InMemoryStore:
return InMemoryStore()
@pytest.fixture
@override
def three_values(self) -> tuple[str, str, str]:
return "value1", "value2", "value3"
class TestAsyncInMemoryStore(BaseStoreAsyncTests):
@pytest.fixture
@override
async def kv_store(self) -> InMemoryStore:
return InMemoryStore()
@pytest.fixture
@override
def three_values(self) -> tuple[str, str, str]:
return "value1", "value2", "value3"
def test_mget() -> None:
store = InMemoryStore()
store.mset([("key1", "value1"), ("key2", "value2")])
values = store.mget(["key1", "key2"])
assert values == ["value1", "value2"]
# Test non-existent key
non_existent_value = store.mget(["key3"])
assert non_existent_value == [None]
async def test_amget() -> None:
store = InMemoryStore()
await store.amset([("key1", "value1"), ("key2", "value2")])
values = await store.amget(["key1", "key2"])
assert values == ["value1", "value2"]
# Test non-existent key
non_existent_value = await store.amget(["key3"])
assert non_existent_value == [None]
// ... (70 more lines)
Domain
Subdomains
Functions
Dependencies
- langchain_core.stores
- langchain_tests.integration_tests.base_store
- pytest
- typing
- typing_extensions
Source
Frequently Asked Questions
What does test_in_memory.py do?
test_in_memory.py is a source file in the langchain codebase, written in python. It belongs to the CoreAbstractions domain, RunnableInterface subdomain.
What functions are defined in test_in_memory.py?
test_in_memory.py defines 8 function(s): test_amdelete, test_amget, test_amset, test_ayield_keys, test_mdelete, test_mget, test_mset, test_yield_keys.
What does test_in_memory.py depend on?
test_in_memory.py imports 5 module(s): langchain_core.stores, langchain_tests.integration_tests.base_store, pytest, typing, typing_extensions.
Where is test_in_memory.py in the architecture?
test_in_memory.py is located at libs/core/tests/unit_tests/stores/test_in_memory.py (domain: CoreAbstractions, subdomain: RunnableInterface, directory: libs/core/tests/unit_tests/stores).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free