test_in_memory_vectorstore.py — langchain Source File
Architecture documentation for test_in_memory_vectorstore.py, a python file in the langchain codebase. 3 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR a35b58f0_4da7_bc7f_4076_b9584badf8d2["test_in_memory_vectorstore.py"] 120e2591_3e15_b895_72b6_cb26195e40a6["pytest"] a35b58f0_4da7_bc7f_4076_b9584badf8d2 --> 120e2591_3e15_b895_72b6_cb26195e40a6 d55af636_303c_0eb6_faee_20d89bd952d5["langchain_core.vectorstores"] a35b58f0_4da7_bc7f_4076_b9584badf8d2 --> d55af636_303c_0eb6_faee_20d89bd952d5 ca44bb2d_b4f4_a662_4f3d_264c2af844ea["langchain_tests.integration_tests.vectorstores"] a35b58f0_4da7_bc7f_4076_b9584badf8d2 --> ca44bb2d_b4f4_a662_4f3d_264c2af844ea style a35b58f0_4da7_bc7f_4076_b9584badf8d2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
from __future__ import annotations
import pytest
from langchain_core.vectorstores import (
InMemoryVectorStore,
VectorStore,
)
from langchain_tests.integration_tests.vectorstores import VectorStoreIntegrationTests
class TestInMemoryVectorStore(VectorStoreIntegrationTests):
@pytest.fixture
def vectorstore(self) -> VectorStore:
embeddings = self.get_embeddings()
return InMemoryVectorStore(embedding=embeddings)
class WithoutGetByIdsVectorStore(InMemoryVectorStore):
"""InMemoryVectorStore that does not implement get_by_ids."""
get_by_ids = VectorStore.get_by_ids
class TestWithoutGetByIdVectorStore(VectorStoreIntegrationTests):
@pytest.fixture
def vectorstore(self) -> VectorStore:
embeddings = self.get_embeddings()
return WithoutGetByIdsVectorStore(embedding=embeddings)
@property
def has_get_by_ids(self) -> bool:
return False
def test_get_by_ids_fails(self, vectorstore: VectorStore) -> None:
with pytest.raises(
NotImplementedError,
match="WithoutGetByIdsVectorStore does not yet support get_by_ids",
):
vectorstore.get_by_ids(["id1", "id2"])
Domain
Subdomains
Dependencies
- langchain_core.vectorstores
- langchain_tests.integration_tests.vectorstores
- pytest
Source
Frequently Asked Questions
What does test_in_memory_vectorstore.py do?
test_in_memory_vectorstore.py is a source file in the langchain codebase, written in python. It belongs to the CoreAbstractions domain, MessageSchema subdomain.
What does test_in_memory_vectorstore.py depend on?
test_in_memory_vectorstore.py imports 3 module(s): langchain_core.vectorstores, langchain_tests.integration_tests.vectorstores, pytest.
Where is test_in_memory_vectorstore.py in the architecture?
test_in_memory_vectorstore.py is located at libs/standard-tests/tests/unit_tests/test_in_memory_vectorstore.py (domain: CoreAbstractions, subdomain: MessageSchema, directory: libs/standard-tests/tests/unit_tests).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free