Home / File/ test_path.py — langchain Source File

test_path.py — langchain Source File

Architecture documentation for test_path.py, a python file in the langchain codebase. 2 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  5ec4ca1f_35e0_aa0e_7c9d_4e5bf67a4458["test_path.py"]
  b6ee5de5_719a_eeb5_1e11_e9c63bc22ef8["pathlib"]
  5ec4ca1f_35e0_aa0e_7c9d_4e5bf67a4458 --> b6ee5de5_719a_eeb5_1e11_e9c63bc22ef8
  b19a8b7e_fbee_95b1_65b8_509a1ed3cad7["langchain_core._api"]
  5ec4ca1f_35e0_aa0e_7c9d_4e5bf67a4458 --> b19a8b7e_fbee_95b1_65b8_509a1ed3cad7
  style 5ec4ca1f_35e0_aa0e_7c9d_4e5bf67a4458 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

from pathlib import Path

from langchain_core._api import path

HERE = Path(__file__).parent

ROOT = HERE.parent.parent.parent


def test_as_import_path() -> None:
    """Test that the path is converted to a LangChain import path."""
    # Verify that default paths are correct

    # if editable install, check directory structure
    if path.PACKAGE_DIR == ROOT / "langchain_core":
        assert path.PACKAGE_DIR == ROOT / "langchain_core"

    # Verify that as import path works correctly
    assert path.as_import_path(HERE, relative_to=ROOT) == "tests.unit_tests._api"
    assert (
        path.as_import_path(__file__, relative_to=ROOT)
        == "tests.unit_tests._api.test_path"
    )
    assert (
        path.as_import_path(__file__, suffix="create_agent", relative_to=ROOT)
        == "tests.unit_tests._api.test_path.create_agent"
    )

Subdomains

Dependencies

  • langchain_core._api
  • pathlib

Frequently Asked Questions

What does test_path.py do?
test_path.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_path.py?
test_path.py defines 1 function(s): test_as_import_path.
What does test_path.py depend on?
test_path.py imports 2 module(s): langchain_core._api, pathlib.
Where is test_path.py in the architecture?
test_path.py is located at libs/core/tests/unit_tests/_api/test_path.py (domain: CoreAbstractions, subdomain: RunnableInterface, directory: libs/core/tests/unit_tests/_api).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free