Home / Function/ test_as_import_path() — langchain Function Reference

test_as_import_path() — langchain Function Reference

Architecture documentation for the test_as_import_path() function in test_path.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  c08a9c8d_0ef9_ff13_b5cc_5432f9bf85f2["test_as_import_path()"]
  0275e6bf_eac1_2b28_34ce_dca065d4f056["test_path.py"]
  c08a9c8d_0ef9_ff13_b5cc_5432f9bf85f2 -->|defined in| 0275e6bf_eac1_2b28_34ce_dca065d4f056
  style c08a9c8d_0ef9_ff13_b5cc_5432f9bf85f2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/_api/test_path.py lines 10–27

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"
    )

Domain

Subdomains

Frequently Asked Questions

What does test_as_import_path() do?
test_as_import_path() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/_api/test_path.py.
Where is test_as_import_path() defined?
test_as_import_path() is defined in libs/core/tests/unit_tests/_api/test_path.py at line 10.

Analyze Your Own Codebase

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

Try Supermodel Free