test_mask_credit_card() — langchain Function Reference
Architecture documentation for the test_mask_credit_card() function in test_pii.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 4503dffe_2185_933d_6706_fd3d9ae63af0["test_mask_credit_card()"] 6da4bcad_d3fd_cbf4_a386_d46859fa4911["TestMaskStrategy"] 4503dffe_2185_933d_6706_fd3d9ae63af0 -->|defined in| 6da4bcad_d3fd_cbf4_a386_d46859fa4911 style 4503dffe_2185_933d_6706_fd3d9ae63af0 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_pii.py lines 271–281
def test_mask_credit_card(self) -> None:
middleware = PIIMiddleware("credit_card", strategy="mask")
# Valid test card
state = AgentState[Any](messages=[HumanMessage("Card: 4532015112830366")])
result = middleware.before_model(state, Runtime())
assert result is not None
content = result["messages"][0].content
assert "0366" in content # Last 4 digits visible
assert "4532015112830366" not in content
Domain
Subdomains
Source
Frequently Asked Questions
What does test_mask_credit_card() do?
test_mask_credit_card() 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_credit_card() defined?
test_mask_credit_card() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_pii.py at line 271.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free