Home / Function/ test_root_only_xml_output_parser() — langchain Function Reference

test_root_only_xml_output_parser() — langchain Function Reference

Architecture documentation for the test_root_only_xml_output_parser() function in test_xml_parser.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  eeed53e8_5b32_15cb_c57b_67f00a27dd45["test_root_only_xml_output_parser()"]
  a1505d99_fe37_04cb_8c81_2640a51076f6["test_xml_parser.py"]
  eeed53e8_5b32_15cb_c57b_67f00a27dd45 -->|defined in| a1505d99_fe37_04cb_8c81_2640a51076f6
  61f10ab4_274d_c282_0340_9648fb40af58["_as_iter()"]
  eeed53e8_5b32_15cb_c57b_67f00a27dd45 -->|calls| 61f10ab4_274d_c282_0340_9648fb40af58
  style eeed53e8_5b32_15cb_c57b_67f00a27dd45 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/output_parsers/test_xml_parser.py lines 79–88

async def test_root_only_xml_output_parser() -> None:
    """Test XMLOutputParser when xml only contains the root level tag."""
    xml_parser = XMLOutputParser(parser="xml")
    assert xml_parser.parse(ROOT_LEVEL_ONLY) == {"body": "Text of the body."}
    assert await xml_parser.aparse(ROOT_LEVEL_ONLY) == {"body": "Text of the body."}
    assert list(xml_parser.transform(iter(ROOT_LEVEL_ONLY))) == [
        {"body": "Text of the body."}
    ]
    chunks = [chunk async for chunk in xml_parser.atransform(_as_iter(ROOT_LEVEL_ONLY))]
    assert chunks == [{"body": "Text of the body."}]

Subdomains

Calls

Frequently Asked Questions

What does test_root_only_xml_output_parser() do?
test_root_only_xml_output_parser() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/output_parsers/test_xml_parser.py.
Where is test_root_only_xml_output_parser() defined?
test_root_only_xml_output_parser() is defined in libs/core/tests/unit_tests/output_parsers/test_xml_parser.py at line 79.
What does test_root_only_xml_output_parser() call?
test_root_only_xml_output_parser() calls 1 function(s): _as_iter.

Analyze Your Own Codebase

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

Try Supermodel Free