Home / Function/ test_block_with_multiple_matches() — langchain Function Reference

test_block_with_multiple_matches() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  8134a015_17c4_136e_ac67_700cff1eec15["test_block_with_multiple_matches()"]
  5ff24760_234b_79ca_abb8_c2089bbd6343["TestBlockStrategy"]
  8134a015_17c4_136e_ac67_700cff1eec15 -->|defined in| 5ff24760_234b_79ca_abb8_c2089bbd6343
  style 8134a015_17c4_136e_ac67_700cff1eec15 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_pii.py lines 339–346

    def test_block_with_multiple_matches(self) -> None:
        middleware = PIIMiddleware("email", strategy="block")
        state = AgentState[Any](messages=[HumanMessage("Emails: alice@test.com and bob@test.com")])

        with pytest.raises(PIIDetectionError) as exc_info:
            middleware.before_model(state, Runtime())

        assert len(exc_info.value.matches) == 2

Domain

Subdomains

Frequently Asked Questions

What does test_block_with_multiple_matches() do?
test_block_with_multiple_matches() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_pii.py.
Where is test_block_with_multiple_matches() defined?
test_block_with_multiple_matches() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_pii.py at line 339.

Analyze Your Own Codebase

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

Try Supermodel Free