Home / Function/ test_hash_email() — langchain Function Reference

test_hash_email() — langchain Function Reference

Architecture documentation for the test_hash_email() function in test_pii.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  c3c876a1_c827_fae6_8692_6cb616474e79["test_hash_email()"]
  da5ecf8c_8ef9_2bb4_25f6_02c8c2010968["TestHashStrategy"]
  c3c876a1_c827_fae6_8692_6cb616474e79 -->|defined in| da5ecf8c_8ef9_2bb4_25f6_02c8c2010968
  style c3c876a1_c827_fae6_8692_6cb616474e79 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_pii.py lines 298–308

    def test_hash_email(self) -> None:
        middleware = PIIMiddleware("email", strategy="hash")
        state = AgentState[Any](messages=[HumanMessage("Email: test@example.com")])

        result = middleware.before_model(state, Runtime())

        assert result is not None
        content = result["messages"][0].content
        assert "<email_hash:" in content
        assert ">" in content
        assert "test@example.com" not in content

Domain

Subdomains

Frequently Asked Questions

What does test_hash_email() do?
test_hash_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_hash_email() defined?
test_hash_email() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_pii.py at line 298.

Analyze Your Own Codebase

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

Try Supermodel Free