Home / Function/ test_default_method_implementations_async() — langchain Function Reference

test_default_method_implementations_async() — langchain Function Reference

Architecture documentation for the test_default_method_implementations_async() function in test_runnable.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  f8fd0071_d931_bd7b_494d_d185445645a6["test_default_method_implementations_async()"]
  26df6ad8_0189_51d0_c3c1_6c3248893ff5["test_runnable.py"]
  f8fd0071_d931_bd7b_494d_d185445645a6 -->|defined in| 26df6ad8_0189_51d0_c3c1_6c3248893ff5
  8652094c_ec57_c551_fc44_9566d00cf872["abatch()"]
  f8fd0071_d931_bd7b_494d_d185445645a6 -->|calls| 8652094c_ec57_c551_fc44_9566d00cf872
  style f8fd0071_d931_bd7b_494d_d185445645a6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/runnables/test_runnable.py lines 1420–1448

async def test_default_method_implementations_async(mocker: MockerFixture) -> None:
    fake = FakeRunnable()
    spy = mocker.spy(fake, "invoke")

    assert await fake.ainvoke("hello", config={"callbacks": []}) == 5
    assert spy.call_args_list == [
        mocker.call("hello", {"callbacks": []}),
    ]
    spy.reset_mock()

    assert [part async for part in fake.astream("hello")] == [5]
    assert spy.call_args_list == [
        mocker.call("hello", None),
    ]
    spy.reset_mock()

    assert await fake.abatch(["hello", "wooorld"], {"metadata": {"key": "value"}}) == [
        5,
        7,
    ]
    assert {call.args[0] for call in spy.call_args_list} == {"hello", "wooorld"}
    for call in spy.call_args_list:
        assert call.args[1] == {
            "metadata": {"key": "value"},
            "tags": [],
            "callbacks": None,
            "recursion_limit": 25,
            "configurable": {},
        }

Domain

Subdomains

Calls

Frequently Asked Questions

What does test_default_method_implementations_async() do?
test_default_method_implementations_async() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/runnables/test_runnable.py.
Where is test_default_method_implementations_async() defined?
test_default_method_implementations_async() is defined in libs/core/tests/unit_tests/runnables/test_runnable.py at line 1420.
What does test_default_method_implementations_async() call?
test_default_method_implementations_async() calls 1 function(s): abatch.

Analyze Your Own Codebase

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

Try Supermodel Free