Home / Function/ test_multiple_items_with_spaces() — langchain Function Reference

test_multiple_items_with_spaces() — langchain Function Reference

Architecture documentation for the test_multiple_items_with_spaces() function in test_list_parser.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  df5e6f40_ef62_65a2_176a_6dc23d34f48e["test_multiple_items_with_spaces()"]
  8ae9f33a_614d_1533_e9a3_2a17ed09b1eb["test_list_parser.py"]
  df5e6f40_ef62_65a2_176a_6dc23d34f48e -->|defined in| 8ae9f33a_614d_1533_e9a3_2a17ed09b1eb
  style df5e6f40_ef62_65a2_176a_6dc23d34f48e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/output_parsers/test_list_parser.py lines 30–49

def test_multiple_items_with_spaces() -> None:
    """Test multiple items with spaces.

    Test that a string with multiple comma-separated items
    with spaces is parsed to a list.
    """
    parser = CommaSeparatedListOutputParser()
    text = "foo, bar, baz"
    expected = ["foo", "bar", "baz"]

    assert parser.parse(text) == expected
    assert add(parser.transform(t for t in text)) == expected
    assert list(parser.transform(t for t in text)) == [[a] for a in expected]
    assert list(parser.transform(t for t in text.splitlines(keepends=True))) == [
        [a] for a in expected
    ]
    assert list(
        parser.transform(" " + t if i > 0 else t for i, t in enumerate(text.split(" ")))
    ) == [[a] for a in expected]
    assert list(parser.transform(iter([text]))) == [[a] for a in expected]

Subdomains

Frequently Asked Questions

What does test_multiple_items_with_spaces() do?
test_multiple_items_with_spaces() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/output_parsers/test_list_parser.py.
Where is test_multiple_items_with_spaces() defined?
test_multiple_items_with_spaces() is defined in libs/core/tests/unit_tests/output_parsers/test_list_parser.py at line 30.

Analyze Your Own Codebase

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

Try Supermodel Free