test_double_escape_handling() — langchain Function Reference
Architecture documentation for the test_double_escape_handling() function in test_serializable.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 4209f521_1764_26ee_927c_789549188624["test_double_escape_handling()"] a193f10f_1a60_b879_b342_d29b1680b3e6["TestEscaping"] 4209f521_1764_26ee_927c_789549188624 -->|defined in| a193f10f_1a60_b879_b342_d29b1680b3e6 style 4209f521_1764_26ee_927c_789549188624 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/load/test_serializable.py lines 514–527
def test_double_escape_handling(self) -> None:
"""Test that data containing escape key itself is properly handled."""
# User data that contains our escape key
data_with_escape_key = {"__lc_escaped__": "some_value"}
doc = Document(page_content="test", metadata=data_with_escape_key)
serialized = dumpd(doc)
# Should be double-escaped since it looks like an escaped dict
assert serialized["kwargs"]["metadata"] == {
"__lc_escaped__": {"__lc_escaped__": "some_value"}
}
loaded = load(serialized, allowed_objects=[Document])
assert loaded.metadata == {"__lc_escaped__": "some_value"}
Domain
Subdomains
Source
Frequently Asked Questions
What does test_double_escape_handling() do?
test_double_escape_handling() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/load/test_serializable.py.
Where is test_double_escape_handling() defined?
test_double_escape_handling() is defined in libs/core/tests/unit_tests/load/test_serializable.py at line 514.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free