Home / Function/ test_multiple_items_with_comma() — langchain Function Reference

test_multiple_items_with_comma() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  9dd89281_7b4e_674c_c4af_52c0e719076d["test_multiple_items_with_comma()"]
  e85257af_7552_a45a_4078_5123cfebbddc["test_list_parser.py"]
  9dd89281_7b4e_674c_c4af_52c0e719076d -->|defined in| e85257af_7552_a45a_4078_5123cfebbddc
  style 9dd89281_7b4e_674c_c4af_52c0e719076d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/output_parsers/test_list_parser.py lines 70–89

def test_multiple_items_with_comma() -> None:
    """Test multiple items with a comma.

    Test that a string with multiple comma-separated items with 1 item containing a
    comma is parsed to a list.
    """
    parser = CommaSeparatedListOutputParser()
    text = '"foo, foo2",bar,baz'
    expected = ["foo, foo2", "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]

Domain

Subdomains

Frequently Asked Questions

What does test_multiple_items_with_comma() do?
test_multiple_items_with_comma() 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_comma() defined?
test_multiple_items_with_comma() is defined in libs/core/tests/unit_tests/output_parsers/test_list_parser.py at line 70.

Analyze Your Own Codebase

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

Try Supermodel Free