test_get_buffer_string_xml_tool_call_special_chars_in_attrs() — langchain Function Reference
Architecture documentation for the test_get_buffer_string_xml_tool_call_special_chars_in_attrs() function in test_utils.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD a585239d_f7c6_e2f5_8a53_3c73e4492b46["test_get_buffer_string_xml_tool_call_special_chars_in_attrs()"] 03f6a5ae_d57a_eb66_626a_b9e082b763ea["test_utils.py"] a585239d_f7c6_e2f5_8a53_3c73e4492b46 -->|defined in| 03f6a5ae_d57a_eb66_626a_b9e082b763ea style a585239d_f7c6_e2f5_8a53_3c73e4492b46 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/messages/test_utils.py lines 2206–2224
def test_get_buffer_string_xml_tool_call_special_chars_in_attrs() -> None:
"""Test that tool call attributes with quotes are properly escaped."""
messages: list[BaseMessage] = [
AIMessage(
content="",
tool_calls=[
{
"name": 'search"with"quotes',
"args": {"query": "test"},
"id": 'call"id',
"type": "tool_call",
},
],
),
]
result = get_buffer_string(messages, format="xml")
# quoteattr uses single quotes when value contains double quotes
assert "name='search\"with\"quotes'" in result
assert "id='call\"id'" in result
Domain
Subdomains
Source
Frequently Asked Questions
What does test_get_buffer_string_xml_tool_call_special_chars_in_attrs() do?
test_get_buffer_string_xml_tool_call_special_chars_in_attrs() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/messages/test_utils.py.
Where is test_get_buffer_string_xml_tool_call_special_chars_in_attrs() defined?
test_get_buffer_string_xml_tool_call_special_chars_in_attrs() is defined in libs/core/tests/unit_tests/messages/test_utils.py at line 2206.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free