test_mask_email() — langchain Function Reference
Architecture documentation for the test_mask_email() function in test_pii.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 05d9f48d_c4ca_16de_28f2_1435499e31e8["test_mask_email()"] 6da4bcad_d3fd_cbf4_a386_d46859fa4911["TestMaskStrategy"] 05d9f48d_c4ca_16de_28f2_1435499e31e8 -->|defined in| 6da4bcad_d3fd_cbf4_a386_d46859fa4911 style 05d9f48d_c4ca_16de_28f2_1435499e31e8 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_pii.py lines 260–269
def test_mask_email(self) -> None:
middleware = PIIMiddleware("email", strategy="mask")
state = AgentState[Any](messages=[HumanMessage("Email: user@example.com")])
result = middleware.before_model(state, Runtime())
assert result is not None
content = result["messages"][0].content
assert "user@****.com" in content
assert "user@example.com" not in content
Domain
Subdomains
Source
Frequently Asked Questions
What does test_mask_email() do?
test_mask_email() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_pii.py.
Where is test_mask_email() defined?
test_mask_email() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_pii.py at line 260.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free