test_single_item_async() — langchain Function Reference
Architecture documentation for the test_single_item_async() function in test_list_parser.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD bb0b7d3e_0ada_685b_fd63_0e67b2c823c2["test_single_item_async()"] 8ae9f33a_614d_1533_e9a3_2a17ed09b1eb["test_list_parser.py"] bb0b7d3e_0ada_685b_fd63_0e67b2c823c2 -->|defined in| 8ae9f33a_614d_1533_e9a3_2a17ed09b1eb f45af033_8079_c0a8_ac59_5f1904e58d19["aiter_from_iter()"] bb0b7d3e_0ada_685b_fd63_0e67b2c823c2 -->|calls| f45af033_8079_c0a8_ac59_5f1904e58d19 style bb0b7d3e_0ada_685b_fd63_0e67b2c823c2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/output_parsers/test_list_parser.py lines 171–198
async def test_single_item_async() -> None:
"""Test that a string with a single item is parsed to a list with that item."""
parser = CommaSeparatedListOutputParser()
text = "foo"
expected = ["foo"]
assert await parser.aparse(text) == expected
assert await aadd(parser.atransform(aiter_from_iter(t for t in text))) == expected
assert [a async for a in parser.atransform(aiter_from_iter(t for t in text))] == [
[a] for a in expected
]
assert [
a
async for a in parser.atransform(
aiter_from_iter(t for t in text.splitlines(keepends=True))
)
] == [[a] for a in expected]
assert [
a
async for a in parser.atransform(
aiter_from_iter(
" " + t if i > 0 else t for i, t in enumerate(text.split(" "))
)
)
] == [[a] for a in expected]
assert [a async for a in parser.atransform(aiter_from_iter([text]))] == [
[a] for a in expected
]
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does test_single_item_async() do?
test_single_item_async() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/output_parsers/test_list_parser.py.
Where is test_single_item_async() defined?
test_single_item_async() is defined in libs/core/tests/unit_tests/output_parsers/test_list_parser.py at line 171.
What does test_single_item_async() call?
test_single_item_async() calls 1 function(s): aiter_from_iter.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free